From 746ccb84714118631983a50d71df3ae654c98479 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:32:48 +0100 Subject: [PATCH 1/3] refactor: fix unused_imports clippy lint --- tests/by-util/test_last.rs | 5 +++-- tests/by-util/test_setpgid.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_last.rs b/tests/by-util/test_last.rs index dce5b3c4..c792f493 100644 --- a/tests/by-util/test_last.rs +++ b/tests/by-util/test_last.rs @@ -4,12 +4,13 @@ // file that was distributed with this source code. // spell-checker:ignore (words) symdir somefakedir +#[cfg(all(unix, not(target_os = "macos")))] use uutests::at_and_ucmd; #[cfg(unix)] use uutests::new_ucmd; -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "macos")))] use uutests::util::TestScenario; -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "macos")))] use uutests::util_name; #[cfg(unix)] diff --git a/tests/by-util/test_setpgid.rs b/tests/by-util/test_setpgid.rs index 8dc0b3ef..38708915 100644 --- a/tests/by-util/test_setpgid.rs +++ b/tests/by-util/test_setpgid.rs @@ -3,6 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#[cfg(target_os = "linux")] use regex::Regex; use uutests::new_ucmd; From 9f29a0e91d77133b71302dbc423e830f88a210e7 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:25:27 +0100 Subject: [PATCH 2/3] build: bump rust-version to 1.85 --- Cargo.toml | 2 +- src/uu/blockdev/Cargo.toml | 1 + src/uu/cal/Cargo.toml | 1 + src/uu/ctrlaltdel/Cargo.toml | 1 + src/uu/dmesg/Cargo.toml | 1 + src/uu/fsfreeze/Cargo.toml | 1 + src/uu/hexdump/Cargo.toml | 1 + src/uu/last/Cargo.toml | 1 + src/uu/lscpu/Cargo.toml | 1 + src/uu/lsmem/Cargo.toml | 1 + src/uu/mcookie/Cargo.toml | 1 + src/uu/mesg/Cargo.toml | 1 + src/uu/mountpoint/Cargo.toml | 1 + src/uu/nologin/Cargo.toml | 1 + src/uu/renice/Cargo.toml | 1 + src/uu/rev/Cargo.toml | 1 + src/uu/setpgid/Cargo.toml | 1 + src/uu/setsid/Cargo.toml | 1 + src/uu/uuidgen/Cargo.toml | 1 + 19 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2b5631a2..701e1cc2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ repository = "https://github.com/uutils/util-linux" readme = "README.md" keywords = ["util-linux", "uutils", "cross-platform", "cli", "utility"] categories = ["command-line-utilities"] -rust-version = "1.70.0" +rust-version = "1.85" edition = "2021" build = "build.rs" diff --git a/src/uu/blockdev/Cargo.toml b/src/uu/blockdev/Cargo.toml index eb814697..e5a15df8 100644 --- a/src/uu/blockdev/Cargo.toml +++ b/src/uu/blockdev/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_blockdev" version = "0.0.1" +rust-version = "1.85" edition = "2021" description = "blockdev ~ Get or set various block device attributes." diff --git a/src/uu/cal/Cargo.toml b/src/uu/cal/Cargo.toml index ddcfefc7..48df32ea 100644 --- a/src/uu/cal/Cargo.toml +++ b/src/uu/cal/Cargo.toml @@ -3,6 +3,7 @@ name = "uu_cal" version = "0.0.1" description = "cal ~ display a calendar" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/ctrlaltdel/Cargo.toml b/src/uu/ctrlaltdel/Cargo.toml index 8641dc18..0830286f 100644 --- a/src/uu/ctrlaltdel/Cargo.toml +++ b/src/uu/ctrlaltdel/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_ctrlaltdel" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/dmesg/Cargo.toml b/src/uu/dmesg/Cargo.toml index 44773d95..25886ffe 100644 --- a/src/uu/dmesg/Cargo.toml +++ b/src/uu/dmesg/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_dmesg" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/fsfreeze/Cargo.toml b/src/uu/fsfreeze/Cargo.toml index d96e2f07..bf4ece8a 100644 --- a/src/uu/fsfreeze/Cargo.toml +++ b/src/uu/fsfreeze/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_fsfreeze" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/hexdump/Cargo.toml b/src/uu/hexdump/Cargo.toml index 97d10f0e..b478c42a 100644 --- a/src/uu/hexdump/Cargo.toml +++ b/src/uu/hexdump/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_hexdump" version = "0.0.1" +rust-version = "1.85" edition = "2021" description = "hexdump ~ display file contents in hexadecimal, decimal, octal, or ascii" diff --git a/src/uu/last/Cargo.toml b/src/uu/last/Cargo.toml index 2e7b73a4..60f5942d 100644 --- a/src/uu/last/Cargo.toml +++ b/src/uu/last/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_last" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/lscpu/Cargo.toml b/src/uu/lscpu/Cargo.toml index 2ece0525..c9894412 100644 --- a/src/uu/lscpu/Cargo.toml +++ b/src/uu/lscpu/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_lscpu" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/lsmem/Cargo.toml b/src/uu/lsmem/Cargo.toml index 47cd8d0d..0e9aa342 100644 --- a/src/uu/lsmem/Cargo.toml +++ b/src/uu/lsmem/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_lsmem" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/mcookie/Cargo.toml b/src/uu/mcookie/Cargo.toml index f50855cf..92f2d388 100644 --- a/src/uu/mcookie/Cargo.toml +++ b/src/uu/mcookie/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_mcookie" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/mesg/Cargo.toml b/src/uu/mesg/Cargo.toml index 382e99c7..a71ff543 100644 --- a/src/uu/mesg/Cargo.toml +++ b/src/uu/mesg/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_mesg" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/mountpoint/Cargo.toml b/src/uu/mountpoint/Cargo.toml index 111bcbfc..d31fdd0f 100644 --- a/src/uu/mountpoint/Cargo.toml +++ b/src/uu/mountpoint/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_mountpoint" version = "0.0.1" +rust-version = "1.85" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/uu/nologin/Cargo.toml b/src/uu/nologin/Cargo.toml index 065d428d..b2edbc58 100644 --- a/src/uu/nologin/Cargo.toml +++ b/src/uu/nologin/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_nologin" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/renice/Cargo.toml b/src/uu/renice/Cargo.toml index 7679013e..09945855 100644 --- a/src/uu/renice/Cargo.toml +++ b/src/uu/renice/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_renice" version = "0.0.1" +rust-version = "1.85" edition = "2021" description = "renice ~ (uutils) Alter priority of running processes" diff --git a/src/uu/rev/Cargo.toml b/src/uu/rev/Cargo.toml index bc570171..0e6e4afc 100644 --- a/src/uu/rev/Cargo.toml +++ b/src/uu/rev/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_rev" version = "0.0.1" +rust-version = "1.85" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/uu/setpgid/Cargo.toml b/src/uu/setpgid/Cargo.toml index cf1eb7fe..28a2f444 100644 --- a/src/uu/setpgid/Cargo.toml +++ b/src/uu/setpgid/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_setpgid" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] diff --git a/src/uu/setsid/Cargo.toml b/src/uu/setsid/Cargo.toml index 9889d5c0..dd253b4b 100644 --- a/src/uu/setsid/Cargo.toml +++ b/src/uu/setsid/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_setsid" version = "0.0.1" +rust-version = "1.85" edition = "2021" [dependencies] diff --git a/src/uu/uuidgen/Cargo.toml b/src/uu/uuidgen/Cargo.toml index 5921a454..7eaf3ba2 100644 --- a/src/uu/uuidgen/Cargo.toml +++ b/src/uu/uuidgen/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "uu_uuidgen" version = "0.0.1" +rust-version = "1.85" edition = "2021" [lib] From 97561174c42d8cc004633f828b60908916420613 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:35:51 +0100 Subject: [PATCH 3/3] build: bump edition to 2024 --- Cargo.toml | 2 +- src/bin/uudoc.rs | 33 +++++++++++++++++------------ src/uu/blockdev/Cargo.toml | 2 +- src/uu/blockdev/src/blockdev.rs | 2 +- src/uu/cal/Cargo.toml | 2 +- src/uu/cal/src/cal.rs | 2 +- src/uu/ctrlaltdel/Cargo.toml | 2 +- src/uu/ctrlaltdel/src/ctrlaltdel.rs | 2 +- src/uu/dmesg/Cargo.toml | 2 +- src/uu/dmesg/src/dmesg.rs | 10 ++++----- src/uu/fsfreeze/Cargo.toml | 2 +- src/uu/fsfreeze/src/fsfreeze.rs | 2 +- src/uu/hexdump/Cargo.toml | 2 +- src/uu/hexdump/src/hexdump.rs | 4 ++-- src/uu/last/Cargo.toml | 2 +- src/uu/last/src/last.rs | 2 +- src/uu/last/src/platform/unix.rs | 2 +- src/uu/lscpu/Cargo.toml | 2 +- src/uu/lscpu/src/lscpu.rs | 7 +++--- src/uu/lsmem/Cargo.toml | 2 +- src/uu/lsmem/src/lsmem.rs | 4 ++-- src/uu/mcookie/Cargo.toml | 2 +- src/uu/mcookie/src/mcookie.rs | 4 ++-- src/uu/mesg/Cargo.toml | 2 +- src/uu/mesg/src/mesg.rs | 6 +++--- src/uu/mountpoint/Cargo.toml | 2 +- src/uu/mountpoint/src/mountpoint.rs | 2 +- src/uu/nologin/Cargo.toml | 2 +- src/uu/nologin/src/nologin.rs | 2 +- src/uu/renice/Cargo.toml | 2 +- src/uu/renice/src/renice.rs | 2 +- src/uu/rev/Cargo.toml | 2 +- src/uu/rev/src/rev.rs | 2 +- src/uu/setpgid/Cargo.toml | 2 +- src/uu/setpgid/src/setpgid.rs | 2 +- src/uu/setsid/Cargo.toml | 2 +- src/uu/setsid/src/setsid.rs | 2 +- src/uu/uuidgen/Cargo.toml | 2 +- src/uu/uuidgen/src/uuidgen.rs | 6 +++--- tests/by-util/test_lslocks.rs | 4 +++- tests/by-util/test_setsid.rs | 2 +- 41 files changed, 74 insertions(+), 68 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 701e1cc2..bba4248a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ readme = "README.md" keywords = ["util-linux", "uutils", "cross-platform", "cli", "utility"] categories = ["command-line-utilities"] rust-version = "1.85" -edition = "2021" +edition = "2024" build = "build.rs" diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index 77c7a2fc..57d206d7 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -20,7 +20,9 @@ fn main() -> io::Result<()> { if tldr_zip.is_none() { println!("Warning: No tldr archive found, so the documentation will not include examples."); - println!("To include examples in the documentation, download the tldr archive and put it in the docs/ folder."); + println!( + "To include examples in the documentation, download the tldr archive and put it in the docs/ folder." + ); println!(); println!(" curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip"); println!(); @@ -107,7 +109,7 @@ fn main() -> io::Result<()> { "| util | Linux | macOS | Windows | FreeBSD | Android |\n\ | ---------------- | ----- | ----- | ------- | ------- | ------- |" )?; - for (&name, _) in &utils { + for &(&name, _) in &utils { if name == "[" { continue; } @@ -141,19 +143,22 @@ fn main() -> io::Result<()> { }) .ok(); - if let Ok(f) = File::create(&p) { - MDWriter { - w: Box::new(f), - command: command(), - name, - tldr_zip: &mut tldr_zip, - utils_per_platform: &utils_per_platform, - markdown, + match File::create(&p) { + Ok(f) => { + MDWriter { + w: Box::new(f), + command: command(), + name, + tldr_zip: &mut tldr_zip, + utils_per_platform: &utils_per_platform, + markdown, + } + .markdown()?; + println!("Wrote to '{}'", p); + } + _ => { + println!("Error writing to {}", p); } - .markdown()?; - println!("Wrote to '{}'", p); - } else { - println!("Error writing to {}", p); } writeln!(summary, "* [{0}](utils/{0}.md)", name)?; } diff --git a/src/uu/blockdev/Cargo.toml b/src/uu/blockdev/Cargo.toml index e5a15df8..a120174f 100644 --- a/src/uu/blockdev/Cargo.toml +++ b/src/uu/blockdev/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_blockdev" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" description = "blockdev ~ Get or set various block device attributes." [lib] diff --git a/src/uu/blockdev/src/blockdev.rs b/src/uu/blockdev/src/blockdev.rs index ffeaf2a4..d2c1172a 100644 --- a/src/uu/blockdev/src/blockdev.rs +++ b/src/uu/blockdev/src/blockdev.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, value_parser, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version, value_parser}; use linux_raw_sys::ioctl::*; #[cfg(target_os = "linux")] use std::collections::BTreeMap; diff --git a/src/uu/cal/Cargo.toml b/src/uu/cal/Cargo.toml index 48df32ea..2f01dbab 100644 --- a/src/uu/cal/Cargo.toml +++ b/src/uu/cal/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.1" description = "cal ~ display a calendar" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/cal.rs" diff --git a/src/uu/cal/src/cal.rs b/src/uu/cal/src/cal.rs index 40895fc4..4337db7e 100644 --- a/src/uu/cal/src/cal.rs +++ b/src/uu/cal/src/cal.rs @@ -4,7 +4,7 @@ // file that was distributed with this source code. use chrono::{Datelike, Local, NaiveDate, Weekday}; -use clap::{crate_version, value_parser, Arg, ArgAction, ArgMatches, Command}; +use clap::{Arg, ArgAction, ArgMatches, Command, crate_version, value_parser}; use std::io::IsTerminal; use uucore::{error::UResult, format_usage, help_about, help_usage}; diff --git a/src/uu/ctrlaltdel/Cargo.toml b/src/uu/ctrlaltdel/Cargo.toml index 0830286f..b896a9b6 100644 --- a/src/uu/ctrlaltdel/Cargo.toml +++ b/src/uu/ctrlaltdel/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_ctrlaltdel" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/ctrlaltdel.rs" diff --git a/src/uu/ctrlaltdel/src/ctrlaltdel.rs b/src/uu/ctrlaltdel/src/ctrlaltdel.rs index 6794ed6b..666fdba8 100644 --- a/src/uu/ctrlaltdel/src/ctrlaltdel.rs +++ b/src/uu/ctrlaltdel/src/ctrlaltdel.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use uucore::{error::UResult, format_usage, help_about, help_usage}; const ABOUT: &str = help_about!("ctrlaltdel.md"); diff --git a/src/uu/dmesg/Cargo.toml b/src/uu/dmesg/Cargo.toml index 25886ffe..afba6a6d 100644 --- a/src/uu/dmesg/Cargo.toml +++ b/src/uu/dmesg/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_dmesg" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/dmesg.rs" diff --git a/src/uu/dmesg/src/dmesg.rs b/src/uu/dmesg/src/dmesg.rs index a4672f1a..bf7e6b40 100644 --- a/src/uu/dmesg/src/dmesg.rs +++ b/src/uu/dmesg/src/dmesg.rs @@ -4,7 +4,7 @@ // file that was distributed with this source code. use chrono::{DateTime, FixedOffset}; -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use regex::Regex; use std::{ collections::HashSet, @@ -51,7 +51,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { return Err(USimpleError::new( 1, format!("unknown time format: {time_format}"), - )) + )); } }; } @@ -294,7 +294,7 @@ impl Dmesg<'_> { fn is_record_in_set( set: &Option>, - ) -> impl Fn(&Result>) -> bool + '_ + ) -> impl Fn(&Result>) -> bool + '_ + use<'_, T> where T: From + Eq + Hash, { @@ -306,7 +306,7 @@ impl Dmesg<'_> { fn is_record_since( since: &Option>, - ) -> impl Fn(&UResult) -> bool + '_ { + ) -> impl Fn(&UResult) -> bool + '_ + use<'_> { move |record: &UResult| match (record, since) { (Ok(record), Some(since)) => { let time = @@ -319,7 +319,7 @@ impl Dmesg<'_> { fn is_record_until( until: &Option>, - ) -> impl Fn(&UResult) -> bool + '_ { + ) -> impl Fn(&UResult) -> bool + '_ + use<'_> { move |record: &UResult| match (record, until) { (Ok(record), Some(until)) => { let time = diff --git a/src/uu/fsfreeze/Cargo.toml b/src/uu/fsfreeze/Cargo.toml index bf4ece8a..3034ef8b 100644 --- a/src/uu/fsfreeze/Cargo.toml +++ b/src/uu/fsfreeze/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_fsfreeze" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/fsfreeze.rs" diff --git a/src/uu/fsfreeze/src/fsfreeze.rs b/src/uu/fsfreeze/src/fsfreeze.rs index 820d9c2d..59a6d91f 100644 --- a/src/uu/fsfreeze/src/fsfreeze.rs +++ b/src/uu/fsfreeze/src/fsfreeze.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, ArgAction, ArgGroup, Command}; +use clap::{Arg, ArgAction, ArgGroup, Command, crate_version}; #[cfg(target_os = "linux")] use std::{fs::File, io, os::fd::AsRawFd}; #[cfg(target_os = "linux")] diff --git a/src/uu/hexdump/Cargo.toml b/src/uu/hexdump/Cargo.toml index b478c42a..1916e9c8 100644 --- a/src/uu/hexdump/Cargo.toml +++ b/src/uu/hexdump/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_hexdump" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" description = "hexdump ~ display file contents in hexadecimal, decimal, octal, or ascii" [lib] diff --git a/src/uu/hexdump/src/hexdump.rs b/src/uu/hexdump/src/hexdump.rs index 115d036d..1b754cc7 100644 --- a/src/uu/hexdump/src/hexdump.rs +++ b/src/uu/hexdump/src/hexdump.rs @@ -7,9 +7,9 @@ use std::collections::BTreeMap; use std::fs::File; use std::io::{BufReader, Read, Seek, SeekFrom}; -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use uucore::{ - error::{set_exit_code, UResult, USimpleError}, + error::{UResult, USimpleError, set_exit_code}, format_usage, help_about, help_usage, parser::parse_size, }; diff --git a/src/uu/last/Cargo.toml b/src/uu/last/Cargo.toml index 60f5942d..32b6a3ec 100644 --- a/src/uu/last/Cargo.toml +++ b/src/uu/last/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_last" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/last.rs" diff --git a/src/uu/last/src/last.rs b/src/uu/last/src/last.rs index 7f1569c0..7099110b 100644 --- a/src/uu/last/src/last.rs +++ b/src/uu/last/src/last.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use uucore::{format_usage, help_about, help_usage}; mod platform; diff --git a/src/uu/last/src/platform/unix.rs b/src/uu/last/src/platform/unix.rs index 9958e600..7f911a92 100644 --- a/src/uu/last/src/platform/unix.rs +++ b/src/uu/last/src/platform/unix.rs @@ -11,7 +11,7 @@ use uucore::error::UResult; use uucore::error::USimpleError; use uucore::utmpx::time::{OffsetDateTime, UtcOffset}; -use uucore::utmpx::{time, Utmpx, UtmpxRecord}; +use uucore::utmpx::{Utmpx, UtmpxRecord, time}; use std::fmt::Write; use std::fs; diff --git a/src/uu/lscpu/Cargo.toml b/src/uu/lscpu/Cargo.toml index c9894412..06e47344 100644 --- a/src/uu/lscpu/Cargo.toml +++ b/src/uu/lscpu/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_lscpu" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/lscpu.rs" diff --git a/src/uu/lscpu/src/lscpu.rs b/src/uu/lscpu/src/lscpu.rs index a7a29723..0fc23ff9 100644 --- a/src/uu/lscpu/src/lscpu.rs +++ b/src/uu/lscpu/src/lscpu.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use regex::RegexBuilder; use serde::Serialize; use std::{cmp, collections::HashMap, fs}; @@ -291,11 +291,10 @@ fn find_cpuinfo_value(contents: &str, key: &str) -> Option { .build() .unwrap(); - let value = re + re .captures_iter(contents) .next() - .map(|cap| cap[1].to_string()); - value + .map(|cap| cap[1].to_string()) } // TODO: This is non-exhaustive and assumes that compile-time arch is the same as runtime diff --git a/src/uu/lsmem/Cargo.toml b/src/uu/lsmem/Cargo.toml index 0e9aa342..60cf9040 100644 --- a/src/uu/lsmem/Cargo.toml +++ b/src/uu/lsmem/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_lsmem" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/lsmem.rs" diff --git a/src/uu/lsmem/src/lsmem.rs b/src/uu/lsmem/src/lsmem.rs index 11f30a26..99ece443 100644 --- a/src/uu/lsmem/src/lsmem.rs +++ b/src/uu/lsmem/src/lsmem.rs @@ -6,13 +6,13 @@ mod utils; use clap::builder::{EnumValueParser, PossibleValue, PossibleValuesParser}; -use clap::{crate_version, Command, ValueEnum}; use clap::{Arg, ArgAction}; +use clap::{Command, ValueEnum, crate_version}; use serde::{Deserialize, Serialize}; use std::borrow::Borrow; use std::fs; use std::io::{self, BufRead, BufReader}; -use std::path::{Path, PathBuf, MAIN_SEPARATOR}; +use std::path::{MAIN_SEPARATOR, Path, PathBuf}; use std::str::FromStr; use uucore::{error::UResult, format_usage, help_about, help_usage}; diff --git a/src/uu/mcookie/Cargo.toml b/src/uu/mcookie/Cargo.toml index 92f2d388..60144094 100644 --- a/src/uu/mcookie/Cargo.toml +++ b/src/uu/mcookie/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_mcookie" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/mcookie.rs" diff --git a/src/uu/mcookie/src/mcookie.rs b/src/uu/mcookie/src/mcookie.rs index 1cbd2022..34fae8ec 100644 --- a/src/uu/mcookie/src/mcookie.rs +++ b/src/uu/mcookie/src/mcookie.rs @@ -5,10 +5,10 @@ use std::{ fs::File, - io::{stdin, Read}, + io::{Read, stdin}, }; -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use md5::{Digest, Md5}; use rand::Rng; use uucore::{ diff --git a/src/uu/mesg/Cargo.toml b/src/uu/mesg/Cargo.toml index a71ff543..52d6fa0d 100644 --- a/src/uu/mesg/Cargo.toml +++ b/src/uu/mesg/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_mesg" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/mesg.rs" diff --git a/src/uu/mesg/src/mesg.rs b/src/uu/mesg/src/mesg.rs index 134fa143..dc999cce 100644 --- a/src/uu/mesg/src/mesg.rs +++ b/src/uu/mesg/src/mesg.rs @@ -3,9 +3,9 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{builder::PossibleValuesParser, crate_version, Arg, ArgAction, ArgMatches, Command}; +use clap::{Arg, ArgAction, ArgMatches, Command, builder::PossibleValuesParser, crate_version}; #[cfg(target_family = "unix")] -use uucore::error::{set_exit_code, UIoError, USimpleError}; +use uucore::error::{UIoError, USimpleError, set_exit_code}; use uucore::{error::UResult, format_usage, help_about, help_usage}; const ABOUT: &str = help_about!("mesg.md"); @@ -13,7 +13,7 @@ const USAGE: &str = help_usage!("mesg.md"); #[cfg(target_family = "unix")] pub fn do_mesg(matches: &ArgMatches) -> UResult<()> { - use nix::sys::stat::{fchmod, fstat, Mode}; + use nix::sys::stat::{Mode, fchmod, fstat}; use std::io; use std::{io::IsTerminal, os::fd::AsFd}; diff --git a/src/uu/mountpoint/Cargo.toml b/src/uu/mountpoint/Cargo.toml index d31fdd0f..6f545c7c 100644 --- a/src/uu/mountpoint/Cargo.toml +++ b/src/uu/mountpoint/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_mountpoint" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/uu/mountpoint/src/mountpoint.rs b/src/uu/mountpoint/src/mountpoint.rs index 6186d908..97d44c18 100644 --- a/src/uu/mountpoint/src/mountpoint.rs +++ b/src/uu/mountpoint/src/mountpoint.rs @@ -4,7 +4,7 @@ // file that was distributed with this source code. use clap::Arg; -use clap::{crate_version, Command}; +use clap::{Command, crate_version}; use std::env; #[cfg(not(windows))] use std::fs; diff --git a/src/uu/nologin/Cargo.toml b/src/uu/nologin/Cargo.toml index b2edbc58..61b3ae97 100644 --- a/src/uu/nologin/Cargo.toml +++ b/src/uu/nologin/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_nologin" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/nologin.rs" diff --git a/src/uu/nologin/src/nologin.rs b/src/uu/nologin/src/nologin.rs index 8c62af4e..5955795a 100644 --- a/src/uu/nologin/src/nologin.rs +++ b/src/uu/nologin/src/nologin.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, ArgAction, Command}; +use clap::{Arg, ArgAction, Command, crate_version}; use std::fs; use uucore::{error::UResult, format_usage, help_about, help_usage}; diff --git a/src/uu/renice/Cargo.toml b/src/uu/renice/Cargo.toml index 09945855..ddfc400a 100644 --- a/src/uu/renice/Cargo.toml +++ b/src/uu/renice/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_renice" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" description = "renice ~ (uutils) Alter priority of running processes" [lib] diff --git a/src/uu/renice/src/renice.rs b/src/uu/renice/src/renice.rs index 2f391639..79d05259 100644 --- a/src/uu/renice/src/renice.rs +++ b/src/uu/renice/src/renice.rs @@ -3,7 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Arg, Command}; +use clap::{Arg, Command, crate_version}; #[cfg(not(windows))] use libc::PRIO_PROCESS; use std::env; diff --git a/src/uu/rev/Cargo.toml b/src/uu/rev/Cargo.toml index 0e6e4afc..ff69217c 100644 --- a/src/uu/rev/Cargo.toml +++ b/src/uu/rev/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_rev" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/uu/rev/src/rev.rs b/src/uu/rev/src/rev.rs index b980d168..4962ba04 100644 --- a/src/uu/rev/src/rev.rs +++ b/src/uu/rev/src/rev.rs @@ -3,8 +3,8 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -use clap::{crate_version, Command}; use clap::{Arg, ArgAction}; +use clap::{Command, crate_version}; use std::env; use std::io::{BufRead, BufReader, Read, Write}; use uucore::{error::UResult, format_usage, help_about, help_usage}; diff --git a/src/uu/setpgid/Cargo.toml b/src/uu/setpgid/Cargo.toml index 28a2f444..e388236c 100644 --- a/src/uu/setpgid/Cargo.toml +++ b/src/uu/setpgid/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_setpgid" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/setpgid.rs" diff --git a/src/uu/setpgid/src/setpgid.rs b/src/uu/setpgid/src/setpgid.rs index 6abf8b09..76462fcc 100644 --- a/src/uu/setpgid/src/setpgid.rs +++ b/src/uu/setpgid/src/setpgid.rs @@ -4,7 +4,7 @@ // file that was distributed with this source code. use clap::builder::ValueParser; -use clap::{crate_version, Arg, ArgAction, Command as ClapCommand}; +use clap::{Arg, ArgAction, Command as ClapCommand, crate_version}; use uucore::{ error::{UResult, USimpleError}, format_usage, help_about, help_usage, diff --git a/src/uu/setsid/Cargo.toml b/src/uu/setsid/Cargo.toml index dd253b4b..9ef00ecf 100644 --- a/src/uu/setsid/Cargo.toml +++ b/src/uu/setsid/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_setsid" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [dependencies] uucore = { workspace = true } diff --git a/src/uu/setsid/src/setsid.rs b/src/uu/setsid/src/setsid.rs index a4d99e55..cc2ded7d 100644 --- a/src/uu/setsid/src/setsid.rs +++ b/src/uu/setsid/src/setsid.rs @@ -4,8 +4,8 @@ // file that was distributed with this source code. use clap::builder::ValueParser; -use clap::{crate_version, Command}; use clap::{Arg, ArgAction}; +use clap::{Command, crate_version}; use uucore::{error::UResult, format_usage, help_about, help_usage}; const ABOUT: &str = help_about!("setsid.md"); diff --git a/src/uu/uuidgen/Cargo.toml b/src/uu/uuidgen/Cargo.toml index 7eaf3ba2..0505a1c8 100644 --- a/src/uu/uuidgen/Cargo.toml +++ b/src/uu/uuidgen/Cargo.toml @@ -2,7 +2,7 @@ name = "uu_uuidgen" version = "0.0.1" rust-version = "1.85" -edition = "2021" +edition = "2024" [lib] path = "src/uuidgen.rs" diff --git a/src/uu/uuidgen/src/uuidgen.rs b/src/uu/uuidgen/src/uuidgen.rs index 4d74bd3c..54845862 100644 --- a/src/uu/uuidgen/src/uuidgen.rs +++ b/src/uu/uuidgen/src/uuidgen.rs @@ -7,14 +7,14 @@ use windows::Win32::{ Foundation::{ERROR_BUFFER_OVERFLOW, ERROR_SUCCESS}, NetworkManagement::IpHelper::{ - GetAdaptersAddresses, GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_DNS_SERVER, - GAA_FLAG_SKIP_FRIENDLY_NAME, GAA_FLAG_SKIP_MULTICAST, GAA_FLAG_SKIP_UNICAST, + GAA_FLAG_SKIP_ANYCAST, GAA_FLAG_SKIP_DNS_SERVER, GAA_FLAG_SKIP_FRIENDLY_NAME, + GAA_FLAG_SKIP_MULTICAST, GAA_FLAG_SKIP_UNICAST, GetAdaptersAddresses, IP_ADAPTER_ADDRESSES_LH, }, Networking::WinSock::AF_UNSPEC, }; -use clap::{crate_version, Arg, ArgAction, ArgGroup, Command}; +use clap::{Arg, ArgAction, ArgGroup, Command, crate_version}; #[cfg(all(target_family = "unix", not(target_os = "redox")))] use nix::ifaddrs::getifaddrs; diff --git a/tests/by-util/test_lslocks.rs b/tests/by-util/test_lslocks.rs index a73d3d5f..f94a25aa 100644 --- a/tests/by-util/test_lslocks.rs +++ b/tests/by-util/test_lslocks.rs @@ -17,6 +17,8 @@ fn test_column_headers() { assert_eq!( cols, - ["COMMAND", "PID", "TYPE", "SIZE", "MODE", "M", "START", "END", "PATH"] + [ + "COMMAND", "PID", "TYPE", "SIZE", "MODE", "M", "START", "END", "PATH" + ] ); } diff --git a/tests/by-util/test_setsid.rs b/tests/by-util/test_setsid.rs index 002873f6..6d96492a 100644 --- a/tests/by-util/test_setsid.rs +++ b/tests/by-util/test_setsid.rs @@ -6,8 +6,8 @@ #[cfg(target_family = "unix")] mod unix { use uutests::new_ucmd; - use uutests::util::get_tests_binary; use uutests::util::UCommand; + use uutests::util::get_tests_binary; #[test] fn test_invalid_arg() {