forked from eminence/terminal-size
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This migrates terminal_size from using libc directly to using rustix, which eliminates a few unsafe blocks and manual error handling. It does also add one new unsafe block, though this is because `terminal_size_using_fd` is a public safe function that has a `RawFd` argument. With [I/O safety], which is expected to be [stabilized in Rust 1.63], there will be new guidance saying be that [such functions should be unsafe]. It's not urgent to make any changes for this right now though. This also updates the minimum Rust version to 1.48, which is about as old as the previous minimum Rust version was when it was last updated. [I/O safety]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md [stabilized in Rust 1.63]: rust-lang/rust#87074 [such functions should be unsafe]: https://doc.rust-lang.org/nightly/std/os/unix/io/index.html
- Loading branch information
1 parent
0f36d74
commit 2d5c1a3
Showing
5 changed files
with
19 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters