fix into_raw_fd impl
This commit is contained in:
1 parent
ce44746a9e
commit
871ce9a6c2
1 file changed
+4
-1
+4
-1
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user