about summary refs log tree commit diff stats
path: root/crates/termsize/src/nix.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-16 18:08:47 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-16 18:08:47 +0100
commit4b63c7be4207bf2ff7884189a388e83633b20b26 (patch)
tree4b4283c6235e2e7af99ed3e1c1eee8b30a4ce00c /crates/termsize/src/nix.rs
parentrefactor(crates/fmt): Init forked `uu_fmt` library (diff)
downloadyt-4b63c7be4207bf2ff7884189a388e83633b20b26.zip
fix(crates/termsize): Remove all of `clippy`'s warnings
Diffstat (limited to 'crates/termsize/src/nix.rs')
-rw-r--r--crates/termsize/src/nix.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/termsize/src/nix.rs b/crates/termsize/src/nix.rs
index 77fa574..e35aa6b 100644
--- a/crates/termsize/src/nix.rs
+++ b/crates/termsize/src/nix.rs
@@ -8,19 +8,15 @@
 // You should have received a copy of the License along with this program.
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-extern crate libc;
-
 use std::io::IsTerminal;
 
-use self::{
-    super::Size,
-    libc::{c_ushort, ioctl, STDOUT_FILENO, TIOCGWINSZ},
-};
+use self::super::Size;
+use libc::{c_ushort, ioctl, STDOUT_FILENO, TIOCGWINSZ};
 
 /// A representation of the size of the current terminal
 #[repr(C)]
 #[derive(Debug)]
-pub struct UnixSize {
+struct UnixSize {
     /// number of rows
     pub rows: c_ushort,
     /// number of columns
@@ -30,6 +26,7 @@ pub struct UnixSize {
 }
 
 /// Gets the current terminal size
+#[must_use]
 pub fn get() -> Option<Size> {
     // http://rosettacode.org/wiki/Terminal_control/Dimensions#Library:_BSD_libc
     if !std::io::stdout().is_terminal() {