Skip to content

Commit 0fbdc8f

Browse files
committed
---
yaml --- r: 227159 b: refs/heads/auto c: e29a62f h: refs/heads/master i: 227157: 653b0d9 227155: fac08d3 227151: 51dfa8e v: v3
1 parent 3cf3105 commit 0fbdc8f

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
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 999bdeca88a06938ac1e1c608091d3afe4d7e173
11+
refs/heads/auto: e29a62f140f3bda4220b47e04623b5a7c7e3e736
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/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)