Skip to content

Commit

Permalink
Merge pull request #57 from chenx97/rustix-0.38
Browse files Browse the repository at this point in the history
Update to rustix 0.38
  • Loading branch information
eminence authored Sep 6, 2023
2 parents 18c58b1 + c24c1c3 commit 27a4459
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/unix.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 27a4459

Please sign in to comment.