Skip to content

Commit dcba3c7

Browse files
committed
---
yaml --- r: 127742 b: refs/heads/snap-stage3 c: 77cdaf0 h: refs/heads/master v: v3
1 parent 0a98dc4 commit dcba3c7

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 49a970f2449a78f28b6c301e542d38593094ca77
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4475e6a095a8fe4459ac8b854ae2336e47aaafe5
4+
refs/heads/snap-stage3: 77cdaf018c98c1a89afcf8382c3f3e90907f49a7
55
refs/heads/try: d9c23fcbaea89871667272a67ecb8d3a512162f3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/time.rs renamed to branches/snap-stage3/src/libstd/time/duration.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ pub struct Duration {
4444
}
4545

4646
/// The minimum possible `Duration`.
47-
pub static MIN_DURATION: Duration = Duration { days: MIN_DAYS, secs: 0, nanos: 0 };
47+
pub static MIN: Duration = Duration { days: MIN_DAYS, secs: 0, nanos: 0 };
4848
/// The maximum possible `Duration`.
49-
pub static MAX_DURATION: Duration = Duration { days: MAX_DAYS, secs: SECS_PER_DAY as u32 - 1,
49+
pub static MAX: Duration = Duration { days: MAX_DAYS, secs: SECS_PER_DAY as u32 - 1,
5050
nanos: NANOS_PER_SEC as u32 - 1 };
5151

5252
impl Duration {
@@ -274,8 +274,8 @@ impl Duration {
274274
}
275275

276276
impl num::Bounded for Duration {
277-
#[inline] fn min_value() -> Duration { MIN_DURATION }
278-
#[inline] fn max_value() -> Duration { MAX_DURATION }
277+
#[inline] fn min_value() -> Duration { MIN }
278+
#[inline] fn max_value() -> Duration { MAX }
279279
}
280280

281281
impl num::Zero for Duration {
@@ -496,7 +496,7 @@ fn div_rem_64(this: i64, other: i64) -> (i64, i64) {
496496

497497
#[cfg(test)]
498498
mod tests {
499-
use super::{Duration, MIN_DAYS, MAX_DAYS, MIN_DURATION, MAX_DURATION};
499+
use super::{Duration, MIN_DAYS, MAX_DAYS, MIN, MAX};
500500
use {i32, i64};
501501
use num::{Zero, CheckedAdd, CheckedSub};
502502
use option::{Some, None};
@@ -533,8 +533,8 @@ mod tests {
533533
assert_eq!(Duration::new(-1, -2, -3_004_005).num_days(), -1);
534534
assert_eq!(Duration::days(i32::MAX).num_days(), i32::MAX);
535535
assert_eq!(Duration::days(i32::MIN).num_days(), i32::MIN);
536-
assert_eq!(MAX_DURATION.num_days(), MAX_DAYS);
537-
assert_eq!(MIN_DURATION.num_days(), MIN_DAYS);
536+
assert_eq!(MAX.num_days(), MAX_DAYS);
537+
assert_eq!(MIN.num_days(), MIN_DAYS);
538538
}
539539

540540
#[test]
@@ -551,8 +551,8 @@ mod tests {
551551
assert_eq!(Duration::new(-1, -2, -3_004_005).num_seconds(), -86402);
552552
assert_eq!(Duration::seconds(i32::MAX).num_seconds(), i32::MAX as i64);
553553
assert_eq!(Duration::seconds(i32::MIN).num_seconds(), i32::MIN as i64);
554-
assert_eq!(MAX_DURATION.num_seconds(), (MAX_DAYS as i64 + 1) * 86400 - 1);
555-
assert_eq!(MIN_DURATION.num_seconds(), MIN_DAYS as i64 * 86400);
554+
assert_eq!(MAX.num_seconds(), (MAX_DAYS as i64 + 1) * 86400 - 1);
555+
assert_eq!(MIN.num_seconds(), MIN_DAYS as i64 * 86400);
556556
}
557557

558558
#[test]
@@ -569,8 +569,8 @@ mod tests {
569569
assert_eq!(Duration::new(-1, -2, -3_004_005).num_milliseconds(), -86402_003);
570570
assert_eq!(Duration::milliseconds(i32::MAX).num_milliseconds(), i32::MAX as i64);
571571
assert_eq!(Duration::milliseconds(i32::MIN).num_milliseconds(), i32::MIN as i64);
572-
assert_eq!(MAX_DURATION.num_milliseconds(), (MAX_DAYS as i64 + 1) * 86400_000 - 1);
573-
assert_eq!(MIN_DURATION.num_milliseconds(), MIN_DAYS as i64 * 86400_000);
572+
assert_eq!(MAX.num_milliseconds(), (MAX_DAYS as i64 + 1) * 86400_000 - 1);
573+
assert_eq!(MIN.num_milliseconds(), MIN_DAYS as i64 * 86400_000);
574574
}
575575

576576
#[test]
@@ -587,8 +587,8 @@ mod tests {
587587
assert_eq!(Duration::new(-1, -2, -3_004_005).num_microseconds(), Some(-86402_003_004));
588588
assert_eq!(Duration::microseconds(i32::MAX).num_microseconds(), Some(i32::MAX as i64));
589589
assert_eq!(Duration::microseconds(i32::MIN).num_microseconds(), Some(i32::MIN as i64));
590-
assert_eq!(MAX_DURATION.num_microseconds(), None);
591-
assert_eq!(MIN_DURATION.num_microseconds(), None);
590+
assert_eq!(MAX.num_microseconds(), None);
591+
assert_eq!(MIN.num_microseconds(), None);
592592

593593
// overflow checks
594594
static MICROS_PER_DAY: i64 = 86400_000_000;
@@ -610,8 +610,8 @@ mod tests {
610610
assert_eq!(Duration::new(-1, -2, -3_004_005).num_nanoseconds(), Some(-86402_003_004_005));
611611
assert_eq!(Duration::nanoseconds(i32::MAX).num_nanoseconds(), Some(i32::MAX as i64));
612612
assert_eq!(Duration::nanoseconds(i32::MIN).num_nanoseconds(), Some(i32::MIN as i64));
613-
assert_eq!(MAX_DURATION.num_nanoseconds(), None);
614-
assert_eq!(MIN_DURATION.num_nanoseconds(), None);
613+
assert_eq!(MAX.num_nanoseconds(), None);
614+
assert_eq!(MIN.num_nanoseconds(), None);
615615

616616
// overflow checks
617617
static NANOS_PER_DAY: i64 = 86400_000_000_000;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Temporal quantification.
12+
13+
pub use self::duration::Duration;
14+
15+
pub mod duration;

0 commit comments

Comments
 (0)