File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -573,14 +573,14 @@ impl<S> AcceptMulti<S> {
573573 }
574574}
575575
576- impl < S : FromRawFd > AcceptMulti < S > {
576+ impl AcceptMulti < ( ) > {
577577 /// Get the accepted socket.
578578 ///
579579 /// # Safety
580580 ///
581581 /// The `result` must be the result of this operation.
582- pub unsafe fn result ( result : io:: Result < usize > ) -> io:: Result < S > {
583- result. map ( |fd| unsafe { S :: from_raw_fd ( fd as _ ) } )
582+ pub unsafe fn result < T : FromRawFd > ( result : io:: Result < usize > ) -> io:: Result < T > {
583+ result. map ( |fd| unsafe { T :: from_raw_fd ( fd as _ ) } )
584584 }
585585}
586586
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ fn accept_multi() {
371371 loop {
372372 let op = AcceptMulti :: new ( server. clone ( ) ) ;
373373 for BufResult ( res, _) in push_and_wait_multi ( & mut driver, op) {
374- let mut client = unsafe { AcceptMulti :: < socket2:: Socket > :: result ( res) . unwrap ( ) } ;
374+ let mut client = unsafe { AcceptMulti :: result :: < socket2:: Socket > ( res) . unwrap ( ) } ;
375375 client
376376 . write_all ( format ! ( "Hello, {}" , i) . as_bytes ( ) )
377377 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments