Skip to content

Commit 23af470

Browse files
authored
breaking: Remove FromRawFd/Handle implementations
This is a breaking change, but I think it's justified for two reasons: - It removes all unsafe code from this crate. - FromRawFd is superseded by From<OwnedFd> cc rust-secure-code/safety-dance#83 Signed-off-by: John Nunley <[email protected]>
1 parent c971597 commit 23af470

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/lib.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
//! # std::io::Result::Ok(()) });
2424
//! ```
2525
26+
#![forbid(unsafe_code)]
2627
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
2728
#![doc(
2829
html_favicon_url = "https://raw.githubusercontent.com/smol-rs/smol/master/assets/images/logo_fullsize_transparent.png"
@@ -1070,20 +1071,6 @@ impl From<std::fs::File> for File {
10701071
}
10711072
}
10721073

1073-
#[cfg(unix)]
1074-
impl std::os::unix::io::FromRawFd for File {
1075-
unsafe fn from_raw_fd(raw: std::os::unix::io::RawFd) -> File {
1076-
File::from(std::fs::File::from_raw_fd(raw))
1077-
}
1078-
}
1079-
1080-
#[cfg(windows)]
1081-
impl std::os::windows::io::FromRawHandle for File {
1082-
unsafe fn from_raw_handle(raw: std::os::windows::io::RawHandle) -> File {
1083-
File::from(std::fs::File::from_raw_handle(raw))
1084-
}
1085-
}
1086-
10871074
#[cfg(unix)]
10881075
impl std::os::unix::io::AsRawFd for File {
10891076
fn as_raw_fd(&self) -> std::os::unix::io::RawFd {

0 commit comments

Comments
 (0)