File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ impl Socket {
387387 pub fn set_linger ( & self , linger : Option < Duration > ) -> io:: Result < ( ) > {
388388 let linger = libc:: linger {
389389 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 ,
391391 } ;
392392
393393 setsockopt ( self , libc:: SOL_SOCKET , SO_LINGER , linger)
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ impl Socket {
449449 pub fn set_linger ( & self , linger : Option < Duration > ) -> io:: Result < ( ) > {
450450 let linger = c:: linger {
451451 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 ,
453453 } ;
454454
455455 net:: setsockopt ( self , c:: SOL_SOCKET , c:: SO_LINGER , linger)
You can’t perform that action at this time.
0 commit comments