Skip to content

Commit 74e9b8e

Browse files
sfacklerbrson
authored andcommitted
---
yaml --- r: 236265 b: refs/heads/stable c: 7a9a90f h: refs/heads/master i: 236263: f86700d v: v3
1 parent 745f517 commit 74e9b8e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: fca6327882a83f29d7c36c9b9edc9309ee5aa05a
32+
refs/heads/stable: 7a9a90f1cd6c0049a32506a2b5310994014e8614
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libstd/time/duration.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,30 @@ impl Duration {
9696
#[stable(feature = "duration", since = "1.3.0")]
9797
pub fn as_secs(&self) -> u64 { self.secs }
9898

99+
#[deprecated(reason = "renamed to `as_secs`", since = "1.3.0")]
100+
#[unstable(feature = "duration_deprecated")]
101+
/// Returns the number of whole seconds represented by this duration.
102+
///
103+
/// The extra precision represented by this duration is ignored (e.g. extra
104+
/// nanoseconds are not represented in the returned value).
105+
pub fn secs(&self) -> u64 { self.as_secs() }
106+
99107
/// Returns the nanosecond precision represented by this duration.
100108
///
101109
/// This method does **not** return the length of the duration when
102110
/// represented by nanoseconds. The returned number always represents a
103111
/// fractional portion of a second (e.g. it is less than one billion).
104112
#[stable(feature = "duration", since = "1.3.0")]
105113
pub fn subsec_nanos(&self) -> u32 { self.nanos }
114+
115+
#[deprecated(reason = "renamed to `subsec_nanos`", since = "1.3.0")]
116+
#[unstable(feature = "duration_deprecated")]
117+
/// Returns the nanosecond precision represented by this duration.
118+
///
119+
/// This method does **not** return the length of the duration when
120+
/// represented by nanoseconds. The returned number always represents a
121+
/// fractional portion of a second (e.g. it is less than one billion).
122+
pub fn extra_nanos(&self) -> u32 { self.subsec_nanos() }
106123
}
107124

108125
impl Add for Duration {

0 commit comments

Comments
 (0)