Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rustix 0.38 #57

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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