diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df8452e..8fd7b74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - toolchain: [1.48.0, stable, beta, nightly] + toolchain: [1.63.0, stable, beta, nightly] steps: - name: Checkout repository uses: actions/checkout@v3 @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [1.48.0, stable, beta, nightly] + toolchain: [1.63.0, stable, beta, nightly] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/Cargo.toml b/Cargo.toml index cc60dac..ff7af2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,11 +7,11 @@ documentation = "https://docs.rs/crate/terminal_size" repository = "https://github.com/eminence/terminal-size" keywords = ["terminal", "console", "term", "size", "dimensions"] license = "MIT OR Apache-2.0" -edition = "2018" +edition = "2021" [target.'cfg(not(windows))'.dependencies] -rustix = { version = "0.37.0", features = ["termios"] } +rustix = { version = "0.38.0", features = ["termios"] } [target.'cfg(windows)'.dependencies.windows-sys] version = "0.48.0" diff --git a/README.md b/README.md index 7257233..30e8872 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ if let Some((Width(w), Height(h))) = size { ## Minimum Rust Version -This crate requires a minimum rust version of 1.48.0 (2020-11-19) +This crate requires a minimum rust version of 1.63.0 (2022-08-11) ## License diff --git a/src/unix.rs b/src/unix.rs index b218b1e..5fc7256 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -1,5 +1,5 @@ use super::{Height, Width}; -use rustix::fd::BorrowedFd; +use rustix::fd::{BorrowedFd, AsRawFd}; use std::os::unix::io::RawFd; /// Returns the size of the terminal. @@ -8,11 +8,11 @@ use std::os::unix::io::RawFd; /// The size of the first stream that is a TTY will be returned. If nothing /// is a TTY, then `None` is returned. pub fn terminal_size() -> Option<(Width, Height)> { - if let Some(size) = terminal_size_using_fd(rustix::io::raw_stdout()) { + if let Some(size) = terminal_size_using_fd(std::io::stdout().as_raw_fd()) { Some(size) - } else if let Some(size) = terminal_size_using_fd(rustix::io::raw_stderr()) { + } else if let Some(size) = terminal_size_using_fd(std::io::stderr().as_raw_fd()) { Some(size) - } else if let Some(size) = terminal_size_using_fd(rustix::io::raw_stdin()) { + } else if let Some(size) = terminal_size_using_fd(std::io::stdin().as_raw_fd()) { Some(size) } else { None