@@ -7,17 +7,17 @@ use std::time::Duration;
77use std:: { cmp, fmt, ops} ;
88
99#[ cfg( any(
10- all( feature = "time" , any( target_os = "android" , target_os = "linux" ) ) ,
11- all(
12- any(
13- target_os = "freebsd" ,
14- target_os = "illumos" ,
15- target_os = "linux" ,
16- target_os = "netbsd"
17- ) ,
18- feature = "time" ,
19- feature = "signal"
20- )
10+ all( feature = "time" , any( target_os = "android" , target_os = "linux" ) ) ,
11+ all(
12+ any(
13+ target_os = "freebsd" ,
14+ target_os = "illumos" ,
15+ target_os = "linux" ,
16+ target_os = "netbsd"
17+ ) ,
18+ feature = "time" ,
19+ feature = "signal"
20+ )
2121) ) ]
2222pub ( crate ) mod timer {
2323 use crate :: sys:: time:: TimeSpec ;
@@ -98,10 +98,10 @@ pub(crate) mod timer {
9898 }
9999 }
100100 #[ cfg( any(
101- target_os = "freebsd" ,
102- target_os = "netbsd" ,
103- target_os = "dragonfly" ,
104- target_os = "illumos"
101+ target_os = "freebsd" ,
102+ target_os = "netbsd" ,
103+ target_os = "dragonfly" ,
104+ target_os = "illumos"
105105 ) ) ]
106106 bitflags ! {
107107 /// Flags that are used for arming the timer.
@@ -114,17 +114,17 @@ pub(crate) mod timer {
114114 fn from ( timerspec : TimerSpec ) -> Expiration {
115115 match timerspec {
116116 TimerSpec ( libc:: itimerspec {
117- it_interval :
118- libc:: timespec {
119- tv_sec : 0 ,
120- tv_nsec : 0 ,
121- } ,
122- it_value : ts,
123- } ) => Expiration :: OneShot ( ts. into ( ) ) ,
117+ it_interval :
118+ libc:: timespec {
119+ tv_sec : 0 ,
120+ tv_nsec : 0 ,
121+ } ,
122+ it_value : ts,
123+ } ) => Expiration :: OneShot ( ts. into ( ) ) ,
124124 TimerSpec ( libc:: itimerspec {
125- it_interval : int_ts,
126- it_value : val_ts,
127- } ) => {
125+ it_interval : int_ts,
126+ it_value : val_ts,
127+ } ) => {
128128 if ( int_ts. tv_sec == val_ts. tv_sec )
129129 && ( int_ts. tv_nsec == val_ts. tv_nsec )
130130 {
@@ -193,7 +193,7 @@ const SECS_PER_MINUTE: i64 = 60;
193193const SECS_PER_HOUR : i64 = 3600 ;
194194
195195#[ cfg( target_pointer_width = "64" ) ]
196- const TS_MAX_SECONDS : i64 = ( :: std :: i64:: MAX / NANOS_PER_SEC ) - 1 ;
196+ const TS_MAX_SECONDS : i64 = ( i64:: MAX / NANOS_PER_SEC ) - 1 ;
197197
198198#[ cfg( target_pointer_width = "32" ) ]
199199const TS_MAX_SECONDS : i64 = :: std:: isize:: MAX as i64 ;
@@ -453,7 +453,7 @@ pub struct TimeVal(timeval);
453453const MICROS_PER_SEC : i64 = 1_000_000 ;
454454
455455#[ cfg( target_pointer_width = "64" ) ]
456- const TV_MAX_SECONDS : i64 = ( :: std :: i64:: MAX / MICROS_PER_SEC ) - 1 ;
456+ const TV_MAX_SECONDS : i64 = ( i64:: MAX / MICROS_PER_SEC ) - 1 ;
457457
458458#[ cfg( target_pointer_width = "32" ) ]
459459const TV_MAX_SECONDS : i64 = :: std:: isize:: MAX as i64 ;
@@ -713,7 +713,7 @@ mod test {
713713
714714 #[ test]
715715 pub fn test_timespec ( ) {
716- assert ! ( TimeSpec :: seconds( 1 ) != TimeSpec :: zero( ) ) ;
716+ assert_ne ! ( TimeSpec :: seconds( 1 ) , TimeSpec :: zero( ) ) ;
717717 assert_eq ! (
718718 TimeSpec :: seconds( 1 ) + TimeSpec :: seconds( 2 ) ,
719719 TimeSpec :: seconds( 3 )
@@ -743,7 +743,7 @@ mod test {
743743
744744 #[ test]
745745 pub fn test_timespec_ord ( ) {
746- assert ! ( TimeSpec :: seconds( 1 ) == TimeSpec :: nanoseconds( 1_000_000_000 ) ) ;
746+ assert_eq ! ( TimeSpec :: seconds( 1 ) , TimeSpec :: nanoseconds( 1_000_000_000 ) ) ;
747747 assert ! ( TimeSpec :: seconds( 1 ) < TimeSpec :: nanoseconds( 1_000_000_001 ) ) ;
748748 assert ! ( TimeSpec :: seconds( 1 ) > TimeSpec :: nanoseconds( 999_999_999 ) ) ;
749749 assert ! ( TimeSpec :: seconds( -1 ) < TimeSpec :: nanoseconds( -999_999_999 ) ) ;
@@ -765,7 +765,7 @@ mod test {
765765
766766 #[ test]
767767 pub fn test_timeval ( ) {
768- assert ! ( TimeVal :: seconds( 1 ) != TimeVal :: zero( ) ) ;
768+ assert_ne ! ( TimeVal :: seconds( 1 ) , TimeVal :: zero( ) ) ;
769769 assert_eq ! (
770770 TimeVal :: seconds( 1 ) + TimeVal :: seconds( 2 ) ,
771771 TimeVal :: seconds( 3 )
@@ -778,7 +778,7 @@ mod test {
778778
779779 #[ test]
780780 pub fn test_timeval_ord ( ) {
781- assert ! ( TimeVal :: seconds( 1 ) == TimeVal :: microseconds( 1_000_000 ) ) ;
781+ assert_eq ! ( TimeVal :: seconds( 1 ) , TimeVal :: microseconds( 1_000_000 ) ) ;
782782 assert ! ( TimeVal :: seconds( 1 ) < TimeVal :: microseconds( 1_000_001 ) ) ;
783783 assert ! ( TimeVal :: seconds( 1 ) > TimeVal :: microseconds( 999_999 ) ) ;
784784 assert ! ( TimeVal :: seconds( -1 ) < TimeVal :: microseconds( -999_999 ) ) ;
0 commit comments