Skip to content

Commit

Permalink
Fix compilation on Rust 1.63. (#37)
Browse files Browse the repository at this point in the history
Avoid using std::os::fd, which isn't available until Rust 1.66. And add
Rust 1.63 testing in CI.
  • Loading branch information
sunfishcode authored Feb 9, 2024
1 parent 5b6308e commit 281999f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [stable, nightly]
build: [msrv, stable, nightly]
include:
- build: msrv
os: ubuntu-latest
rust: 1.63
- build: stable
os: ubuntu-latest
rust: stable
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
no_std
)]

#[cfg(any(unix, target_os = "wasi"))]
use std::os::fd::{AsFd, AsRawFd};
#[cfg(target_os = "hermit")]
use std::os::hermit::io::AsFd;
#[cfg(unix)]
use std::os::unix::io::{AsFd, AsRawFd};
#[cfg(target_os = "wasi")]
use std::os::wasi::io::{AsFd, AsRawFd};
#[cfg(windows)]
use std::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle};
#[cfg(windows)]
Expand Down

0 comments on commit 281999f

Please sign in to comment.