From 2338ed1cc19d7e3686ceb51afb59af81a990c2fb Mon Sep 17 00:00:00 2001 From: Andrew Hickman Date: Wed, 23 Oct 2024 21:31:10 +0100 Subject: [PATCH] Remove io_safety feature flag --- .github/workflows/ci.yml | 7 ------- CHANGELOG.md | 2 ++ Cargo.toml | 3 --- src/file.rs | 8 ++------ 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e467637..1613147 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,6 @@ jobs: args: --tests -- -D warnings if: matrix.rust_version == 'stable' - - name: cargo check --features "io_safety" - uses: actions-rs/cargo@v1 - with: - command: check - args: --features io_safety - if: ${{ matrix.rust_version == 'stable' || matrix.rust_version == 'beta' }} - - name: cargo check --features tokio uses: actions-rs/cargo@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index f3a4eeb..84d3fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ Note that the original error is no longer exposed though [`Error::source()`](https://doc.rust-lang.org/stable/std/error/trait.Error.html#method.source) by default. If you need access to it, you can restore the previous behaviour with the `expose_original_error` feature flag. +* The `io_safety` feature flag has been removed, and this functionality is now always enabled on Rust versions which support it (1.63.0 and greater). + ## 2.11.0 * Added the first line of the standard library documentation to each function's rustdocs, to make them more useful in IDEs ([#50](https://github.com/andrewhickman/fs-err/issues/45)) diff --git a/Cargo.toml b/Cargo.toml index dd8e02b..b4f291c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,9 +21,6 @@ autocfg = "1" serde_json = "1.0.64" [features] -# Adds I/O safety traits, introduced in Rust 1.63 -io_safety = [] - # Allow custom formatting of the error source # # When enabled errors emit `std::error::Error::source()` as Some (default is `None`) and diff --git a/src/file.rs b/src/file.rs index a0ffeee..4040524 100644 --- a/src/file.rs +++ b/src/file.rs @@ -303,18 +303,16 @@ mod unix { } } - #[cfg(feature = "io_safety")] + #[cfg(rustc_1_63)] mod io_safety { use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd}; - #[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))] impl AsFd for crate::File { fn as_fd(&self) -> BorrowedFd<'_> { self.file().as_fd() } } - #[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))] impl From for OwnedFd { fn from(file: crate::File) -> Self { file.into_parts().0.into() @@ -363,18 +361,16 @@ mod windows { } } - #[cfg(feature = "io_safety")] + #[cfg(rustc_1_63)] mod io_safety { use std::os::windows::io::{AsHandle, BorrowedHandle, OwnedHandle}; - #[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))] impl AsHandle for crate::File { fn as_handle(&self) -> BorrowedHandle<'_> { self.file().as_handle() } } - #[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))] impl From for OwnedHandle { fn from(file: crate::File) -> Self { file.into_parts().0.into()