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 {
373373 /// # Examples
374374 ///
375375 /// ```
376- /// #![feature(duration_constructors )]
376+ /// #![feature(duration_constructors_lite )]
377377 /// use std::time::Duration;
378378 ///
379379 /// let duration = Duration::from_hours(6);
380380 ///
381381 /// assert_eq!(6 * 60 * 60, duration.as_secs());
382382 /// assert_eq!(0, duration.subsec_nanos());
383383 /// ```
384- #[ unstable( feature = "duration_constructors " , issue = "120301 " ) ]
384+ #[ unstable( feature = "duration_constructors_lite " , issue = "140881 " ) ]
385385 #[ must_use]
386386 #[ inline]
387387 pub const fn from_hours ( hours : u64 ) -> Duration {
@@ -401,15 +401,15 @@ impl Duration {
401401 /// # Examples
402402 ///
403403 /// ```
404- /// #![feature(duration_constructors )]
404+ /// #![feature(duration_constructors_lite )]
405405 /// use std::time::Duration;
406406 ///
407407 /// let duration = Duration::from_mins(10);
408408 ///
409409 /// assert_eq!(10 * 60, duration.as_secs());
410410 /// assert_eq!(0, duration.subsec_nanos());
411411 /// ```
412- #[ unstable( feature = "duration_constructors " , issue = "120301 " ) ]
412+ #[ unstable( feature = "duration_constructors_lite " , issue = "140881 " ) ]
413413 #[ must_use]
414414 #[ inline]
415415 pub const fn from_mins ( mins : u64 ) -> Duration {
Original file line number Diff line number Diff line change 2424#![ feature( dec2flt) ]
2525#![ feature( duration_constants) ]
2626#![ feature( duration_constructors) ]
27+ #![ feature( duration_constructors_lite) ]
2728#![ feature( error_generic_member_access) ]
2829#![ feature( exact_size_is_empty) ]
2930#![ feature( extend_one) ]
Original file line number Diff line number Diff line change @@ -46,16 +46,25 @@ fn from_weeks_overflow() {
4646}
4747
4848#[ test]
49- fn constructors ( ) {
49+ fn constructor_weeks ( ) {
5050 assert_eq ! ( Duration :: from_weeks( 1 ) , Duration :: from_secs( 7 * 24 * 60 * 60 ) ) ;
5151 assert_eq ! ( Duration :: from_weeks( 0 ) , Duration :: ZERO ) ;
52+ }
5253
54+ #[ test]
55+ fn constructor_days ( ) {
5356 assert_eq ! ( Duration :: from_days( 1 ) , Duration :: from_secs( 86_400 ) ) ;
5457 assert_eq ! ( Duration :: from_days( 0 ) , Duration :: ZERO ) ;
58+ }
5559
60+ #[ test]
61+ fn constructor_hours ( ) {
5662 assert_eq ! ( Duration :: from_hours( 1 ) , Duration :: from_secs( 3_600 ) ) ;
5763 assert_eq ! ( Duration :: from_hours( 0 ) , Duration :: ZERO ) ;
64+ }
5865
66+ #[ test]
67+ fn constructor_minutes ( ) {
5968 assert_eq ! ( Duration :: from_mins( 1 ) , Duration :: from_secs( 60 ) ) ;
6069 assert_eq ! ( Duration :: from_mins( 0 ) , Duration :: ZERO ) ;
6170}
You can’t perform that action at this time.
0 commit comments