Skip to content

Commit

Permalink
Update to rustix 0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
chenx97 authored and eminence committed Sep 4, 2023
1 parent 18c58b1 commit 78e13c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"


[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
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 78e13c7

Please sign in to comment.