From aaa95161d5d33f4d8889e7d8cdab8cfc2eaf7789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= Date: Fri, 27 Jan 2023 14:21:58 +0100 Subject: [PATCH] landlock: Switch to the 2021 Rust edition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cosmetic changes to format string following Clippy 1.66.0 suggestions: https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args Signed-off-by: Mickaël Salaün --- Cargo.toml | 2 +- src/compat.rs | 4 ++-- src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d46898c9..6dfd28a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Mickaël Salaün ", "Vincent Dagonneau " ] -edition = "2018" +edition = "2021" rust-version = "1.63" description = "Landlock LSM helpers" homepage = "https://landlock.io" diff --git a/src/compat.rs b/src/compat.rs index 465800e9..0b07893b 100644 --- a/src/compat.rs +++ b/src/compat.rs @@ -116,11 +116,11 @@ lazy_static! { if ABI::is_known(n) || n == 0 { ABI::from(n) } else { - panic!("Unknown ABI: {}", n); + panic!("Unknown ABI: {n}"); } } Err(std::env::VarError::NotPresent) => ABI::iter().last().unwrap(), - Err(e) => panic!("Failed to read LANDLOCK_CRATE_TEST_ABI: {}", e), + Err(e) => panic!("Failed to read LANDLOCK_CRATE_TEST_ABI: {e}"), }; } diff --git a/src/lib.rs b/src/lib.rs index 1d5894de..2fe7164b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,7 +121,7 @@ mod tests { let ret = check(Ruleset::from(abi)); // Useful for failed tests and with cargo test -- --show-output - println!("Checking ABI {:?}, expecting {:#?}", abi, ret); + println!("Checking ABI {abi:?}, expecting {ret:#?}"); if can_emulate(abi, full) { if abi < partial && error_if_abi_lt_partial { // TODO: Check exact error type; this may require better error types.