File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ impl Socket {
387
387
pub fn set_linger ( & self , linger : Option < Duration > ) -> io:: Result < ( ) > {
388
388
let linger = libc:: linger {
389
389
l_onoff : linger. is_some ( ) as libc:: c_int ,
390
- l_linger : linger. map ( |dur| dur . as_secs ( ) as libc:: c_int ) . unwrap_or_default ( ) ,
390
+ l_linger : linger. unwrap_or_default ( ) . as_secs ( ) as libc:: c_int ,
391
391
} ;
392
392
393
393
setsockopt ( self , libc:: SOL_SOCKET , SO_LINGER , linger)
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ impl Socket {
449
449
pub fn set_linger ( & self , linger : Option < Duration > ) -> io:: Result < ( ) > {
450
450
let linger = c:: linger {
451
451
l_onoff : linger. is_some ( ) as c_ushort ,
452
- l_linger : linger. map ( |dur| dur . as_secs ( ) as c_ushort ) . unwrap_or_default ( ) ,
452
+ l_linger : linger. unwrap_or_default ( ) . as_secs ( ) as c_ushort ,
453
453
} ;
454
454
455
455
net:: setsockopt ( self , c:: SOL_SOCKET , c:: SO_LINGER , linger)
You can’t perform that action at this time.
0 commit comments