File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -661,18 +661,16 @@ pub trait SocketExtManual: IsA<Socket> + Sized {
661
661
#[ cfg_attr( docsrs, doc( cfg( unix) ) ) ]
662
662
#[ doc( alias = "get_fd" ) ]
663
663
#[ doc( alias = "g_socket_get_fd" ) ]
664
- fn fd < T : FromRawFd > ( & self ) -> T {
665
- unsafe { FromRawFd :: from_raw_fd ( ffi :: g_socket_get_fd ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ) }
664
+ fn fd ( & self ) -> BorrowedFd < ' _ > {
665
+ self . as_ref ( ) . as_fd ( )
666
666
}
667
667
668
668
#[ cfg( windows) ]
669
669
#[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
670
670
#[ doc( alias = "get_socket" ) ]
671
671
#[ doc( alias = "g_socket_get_fd" ) ]
672
- fn socket < T : FromRawSocket > ( & self ) -> T {
673
- unsafe {
674
- FromRawSocket :: from_raw_socket ( ffi:: g_socket_get_fd ( self . as_ref ( ) . to_glib_none ( ) . 0 ) as _ )
675
- }
672
+ fn socket ( & self ) -> BorrowedSocket < ' _ > {
673
+ self . as_ref ( ) . as_socket ( )
676
674
}
677
675
678
676
#[ doc( alias = "g_socket_create_source" ) ]
You can’t perform that action at this time.
0 commit comments