@@ -174,7 +174,7 @@ macro_rules! syscall {
174174
175175/// Maximum size of a buffer passed to system call like `recv` and `send`.
176176#[ cfg( not( target_vendor = "apple" ) ) ]
177- const MAX_BUF_LEN : usize = < ssize_t > :: max_value ( ) as usize ;
177+ const MAX_BUF_LEN : usize = ssize_t:: MAX as usize ;
178178
179179// The maximum read limit on most posix-like systems is `SSIZE_MAX`, with the
180180// man page quoting that if the count of bytes to read is greater than
@@ -185,7 +185,7 @@ const MAX_BUF_LEN: usize = <ssize_t>::max_value() as usize;
185185// than or equal to INT_MAX. To handle both of these the read size is capped on
186186// both platforms.
187187#[ cfg( target_vendor = "apple" ) ]
188- const MAX_BUF_LEN : usize = < c_int > :: max_value ( ) as usize - 1 ;
188+ const MAX_BUF_LEN : usize = c_int:: MAX as usize - 1 ;
189189
190190#[ cfg( any(
191191 all(
@@ -622,7 +622,7 @@ pub(crate) fn poll_connect(socket: &crate::Socket, timeout: Duration) -> io::Res
622622 }
623623
624624 let timeout = ( timeout - elapsed) . as_millis ( ) ;
625- let timeout = clamp ( timeout, 1 , c_int:: max_value ( ) as u128 ) as c_int ;
625+ let timeout = clamp ( timeout, 1 , c_int:: MAX as u128 ) as c_int ;
626626
627627 match syscall ! ( poll( & mut pollfd, 1 , timeout) ) {
628628 Ok ( 0 ) => return Err ( io:: ErrorKind :: TimedOut . into ( ) ) ,
@@ -878,7 +878,7 @@ fn into_timeval(duration: Option<Duration>) -> libc::timeval {
878878 // https://github.com/rust-lang/libc/issues/1848
879879 #[ cfg_attr( target_env = "musl" , allow( deprecated) ) ]
880880 Some ( duration) => libc:: timeval {
881- tv_sec : min ( duration. as_secs ( ) , libc:: time_t:: max_value ( ) as u64 ) as libc:: time_t ,
881+ tv_sec : min ( duration. as_secs ( ) , libc:: time_t:: MAX as u64 ) as libc:: time_t ,
882882 tv_usec : duration. subsec_micros ( ) as libc:: suseconds_t ,
883883 } ,
884884 None => libc:: timeval {
@@ -931,7 +931,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
931931
932932#[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
933933fn into_secs ( duration : Duration ) -> c_int {
934- min ( duration. as_secs ( ) , c_int:: max_value ( ) as u64 ) as c_int
934+ min ( duration. as_secs ( ) , c_int:: MAX as u64 ) as c_int
935935}
936936
937937/// Add `flag` to the current set flags of `F_GETFD`.
0 commit comments