From 2d8728087d7768541148849538e6037917f1d817 Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Mon, 13 Jan 2025 14:50:38 -0800 Subject: [PATCH] refactor: use `next_back` instead of `last` on double-ended iterators (`clippy::double_ended_iterator_last`) (#262) --- crates/wdk-build/src/cargo_make.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/wdk-build/src/cargo_make.rs b/crates/wdk-build/src/cargo_make.rs index 26be9942..a900bf35 100644 --- a/crates/wdk-build/src/cargo_make.rs +++ b/crates/wdk-build/src/cargo_make.rs @@ -1121,7 +1121,7 @@ mod tests { || panic!("Couldn't get OS string"), |os_env_string| os_env_string.to_string_lossy().into_owned(), ); - assert_eq!(env_string.split(' ').last(), Some("/msft")); + assert_eq!(env_string.split(' ').next_back(), Some("/msft")); crate::cargo_make::setup_infverif_for_samples(WDK_TEST_NEW_INF_VERSION)?; let env_string = std::env::var_os(crate::cargo_make::WDK_INF_ADDITIONAL_FLAGS_ENV_VAR) @@ -1129,7 +1129,7 @@ mod tests { || panic!("Couldn't get OS string"), |os_env_string| os_env_string.to_string_lossy().into_owned(), ); - assert_eq!(env_string.split(' ').last(), Some("/samples")); + assert_eq!(env_string.split(' ').next_back(), Some("/samples")); Ok(()) } }