Skip to content

Commit 27144b0

Browse files
Remove io_safety feature flag (#65)
1 parent 1a26274 commit 27144b0

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

.github/workflows/ci.yml

-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ jobs:
5454
args: --tests -- -D warnings
5555
if: matrix.rust_version == 'stable'
5656

57-
- name: cargo check --features "io_safety"
58-
uses: actions-rs/cargo@v1
59-
with:
60-
command: check
61-
args: --features io_safety
62-
if: ${{ matrix.rust_version == 'stable' || matrix.rust_version == 'beta' }}
63-
6457
- name: cargo check --features tokio
6558
uses: actions-rs/cargo@v1
6659
with:

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
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.
1818

19+
* 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).
20+
1921
## 2.11.0
2022

2123
* 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))

Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ autocfg = "1"
2121
serde_json = "1.0.64"
2222

2323
[features]
24-
# Adds I/O safety traits, introduced in Rust 1.63
25-
io_safety = []
26-
2724
# Allow custom formatting of the error source
2825
#
2926
# When enabled errors emit `std::error::Error::source()` as Some (default is `None`) and

src/file.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,16 @@ mod unix {
303303
}
304304
}
305305

306-
#[cfg(feature = "io_safety")]
306+
#[cfg(rustc_1_63)]
307307
mod io_safety {
308308
use std::os::unix::io::{AsFd, BorrowedFd, OwnedFd};
309309

310-
#[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))]
311310
impl AsFd for crate::File {
312311
fn as_fd(&self) -> BorrowedFd<'_> {
313312
self.file().as_fd()
314313
}
315314
}
316315

317-
#[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))]
318316
impl From<crate::File> for OwnedFd {
319317
fn from(file: crate::File) -> Self {
320318
file.into_parts().0.into()
@@ -363,18 +361,16 @@ mod windows {
363361
}
364362
}
365363

366-
#[cfg(feature = "io_safety")]
364+
#[cfg(rustc_1_63)]
367365
mod io_safety {
368366
use std::os::windows::io::{AsHandle, BorrowedHandle, OwnedHandle};
369367

370-
#[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))]
371368
impl AsHandle for crate::File {
372369
fn as_handle(&self) -> BorrowedHandle<'_> {
373370
self.file().as_handle()
374371
}
375372
}
376373

377-
#[cfg_attr(docsrs, doc(cfg(feature = "io_safety")))]
378374
impl From<crate::File> for OwnedHandle {
379375
fn from(file: crate::File) -> Self {
380376
file.into_parts().0.into()

0 commit comments

Comments
 (0)