fix into_raw_fd impl

This commit is contained in:
Wez Furlong committed 2019-03-02 12:22:42 -08:00
1 parent ce44746a9e
commit 871ce9a6c2
1 file changed
+4 -1
+4 -1
View File
@@ -11,6 +11,7 @@ use std::ptr;
pub use std::process::{Child, Command, ExitStatus};
#[derive(Debug)]
pub struct OwnedFd {
fd: RawFd,
}
@@ -47,7 +48,9 @@ impl AsRawFd for OwnedFd {
impl IntoRawFd for OwnedFd {
fn into_raw_fd(self) -> RawFd {
self.fd
let fd = self.fd;
mem::forget(self);
fd
}
}