diff --git a/gio/src/socket.rs b/gio/src/socket.rs index b5b4a41f4faf..835491e28e5d 100644 --- a/gio/src/socket.rs +++ b/gio/src/socket.rs @@ -819,7 +819,10 @@ mod tests { #[test] #[cfg(unix)] fn socket_messages() { - use std::{io, os::unix::io::AsRawFd}; + use std::{ + io, + os::unix::io::{AsRawFd, FromRawFd, OwnedFd}, + }; use super::Socket; use crate::{prelude::*, Cancellable, UnixFDMessage}; @@ -831,8 +834,8 @@ mod tests { panic!("{}", io::Error::last_os_error()); } ( - Socket::from_fd(fds[0]).unwrap(), - Socket::from_fd(fds[1]).unwrap(), + Socket::from_fd(OwnedFd::from_raw_fd(fds[0])).unwrap(), + Socket::from_fd(OwnedFd::from_raw_fd(fds[1])).unwrap(), ) };