Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b8f2674e
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b8f2674e
编写于
1月 31, 2018
作者:
B
bors
浏览文件
操作
浏览文件
下载
差异文件
Auto merge of #46666 - clarcharr:duration_core, r=alexcrichton
Move Duration to libcore Fixes #46520; should be merged after #46508.
上级
def3269a
aab712cb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
4 deletion
+16
-4
src/libcore/lib.rs
src/libcore/lib.rs
+1
-0
src/libcore/time.rs
src/libcore/time.rs
+14
-1
src/libstd/time.rs
src/libstd/time.rs
+1
-3
未找到文件。
src/libcore/lib.rs
浏览文件 @
b8f2674e
...
...
@@ -168,6 +168,7 @@
pub
mod
str
;
pub
mod
hash
;
pub
mod
fmt
;
pub
mod
time
;
// note: does not need to be public
mod
char_private
;
...
...
src/lib
std/time/duration
.rs
→
src/lib
core/time
.rs
浏览文件 @
b8f2674e
...
...
@@ -7,6 +7,19 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![stable(feature
=
"duration_core"
,
since
=
"1.24.0"
)]
//! Temporal quantification.
//!
//! Example:
//!
//! ```
//! use std::time::Duration;
//!
//! let five_seconds = Duration::new(5, 0);
//! // both declarations are equivalent
//! assert_eq!(Duration::new(5, 0), Duration::from_secs(5));
//! ```
use
iter
::
Sum
;
use
ops
::{
Add
,
Sub
,
Mul
,
Div
,
AddAssign
,
SubAssign
,
MulAssign
,
DivAssign
};
...
...
@@ -45,7 +58,7 @@
///
/// let ten_millis = Duration::from_millis(10);
/// ```
#[stable(feature
=
"duration
"
,
since
=
"1.3
.0"
)]
#[stable(feature
=
"duration
_core"
,
since
=
"1.24
.0"
)]
#[derive(Clone,
Copy,
PartialEq,
Eq,
PartialOrd,
Ord,
Debug,
Hash,
Default)]
pub
struct
Duration
{
secs
:
u64
,
...
...
src/libstd/time
/mod
.rs
→
src/libstd/time.rs
浏览文件 @
b8f2674e
...
...
@@ -29,9 +29,7 @@
use
sys_common
::
FromInner
;
#[stable(feature
=
"time"
,
since
=
"1.3.0"
)]
pub
use
self
::
duration
::
Duration
;
mod
duration
;
pub
use
core
::
time
::
Duration
;
/// A measurement of a monotonically nondecreasing clock.
/// Opaque and useful only with `Duration`.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录