File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -373,15 +373,15 @@ impl Duration {
373
373
/// # Examples
374
374
///
375
375
/// ```
376
- /// #![feature(duration_constructors )]
376
+ /// #![feature(duration_constructors_lite )]
377
377
/// use std::time::Duration;
378
378
///
379
379
/// let duration = Duration::from_hours(6);
380
380
///
381
381
/// assert_eq!(6 * 60 * 60, duration.as_secs());
382
382
/// assert_eq!(0, duration.subsec_nanos());
383
383
/// ```
384
- #[ unstable( feature = "duration_constructors " , issue = "120301 " ) ]
384
+ #[ unstable( feature = "duration_constructors_lite " , issue = "140881 " ) ]
385
385
#[ must_use]
386
386
#[ inline]
387
387
pub const fn from_hours ( hours : u64 ) -> Duration {
@@ -401,15 +401,15 @@ impl Duration {
401
401
/// # Examples
402
402
///
403
403
/// ```
404
- /// #![feature(duration_constructors )]
404
+ /// #![feature(duration_constructors_lite )]
405
405
/// use std::time::Duration;
406
406
///
407
407
/// let duration = Duration::from_mins(10);
408
408
///
409
409
/// assert_eq!(10 * 60, duration.as_secs());
410
410
/// assert_eq!(0, duration.subsec_nanos());
411
411
/// ```
412
- #[ unstable( feature = "duration_constructors " , issue = "120301 " ) ]
412
+ #[ unstable( feature = "duration_constructors_lite " , issue = "140881 " ) ]
413
413
#[ must_use]
414
414
#[ inline]
415
415
pub const fn from_mins ( mins : u64 ) -> Duration {
Original file line number Diff line number Diff line change 24
24
#![ feature( dec2flt) ]
25
25
#![ feature( duration_constants) ]
26
26
#![ feature( duration_constructors) ]
27
+ #![ feature( duration_constructors_lite) ]
27
28
#![ feature( error_generic_member_access) ]
28
29
#![ feature( exact_size_is_empty) ]
29
30
#![ feature( extend_one) ]
Original file line number Diff line number Diff line change @@ -46,16 +46,25 @@ fn from_weeks_overflow() {
46
46
}
47
47
48
48
#[ test]
49
- fn constructors ( ) {
49
+ fn constructor_weeks ( ) {
50
50
assert_eq ! ( Duration :: from_weeks( 1 ) , Duration :: from_secs( 7 * 24 * 60 * 60 ) ) ;
51
51
assert_eq ! ( Duration :: from_weeks( 0 ) , Duration :: ZERO ) ;
52
+ }
52
53
54
+ #[ test]
55
+ fn constructor_days ( ) {
53
56
assert_eq ! ( Duration :: from_days( 1 ) , Duration :: from_secs( 86_400 ) ) ;
54
57
assert_eq ! ( Duration :: from_days( 0 ) , Duration :: ZERO ) ;
58
+ }
55
59
60
+ #[ test]
61
+ fn constructor_hours ( ) {
56
62
assert_eq ! ( Duration :: from_hours( 1 ) , Duration :: from_secs( 3_600 ) ) ;
57
63
assert_eq ! ( Duration :: from_hours( 0 ) , Duration :: ZERO ) ;
64
+ }
58
65
66
+ #[ test]
67
+ fn constructor_minutes ( ) {
59
68
assert_eq ! ( Duration :: from_mins( 1 ) , Duration :: from_secs( 60 ) ) ;
60
69
assert_eq ! ( Duration :: from_mins( 0 ) , Duration :: ZERO ) ;
61
70
}
You can’t perform that action at this time.
0 commit comments