From a33302aff9eba46eb2414d0b885ae6475dd39720 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Wed, 15 Jan 2025 21:23:40 +0100 Subject: [PATCH] refactor: apply clippy lints --- src/cli/commands/add.rs | 2 +- src/cli/install.rs | 2 +- src/cli/version.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/add.rs b/src/cli/commands/add.rs index aa7b759..6af40d8 100644 --- a/src/cli/commands/add.rs +++ b/src/cli/commands/add.rs @@ -186,7 +186,7 @@ impl AddCommand { .path .to_string() .split('/') - .last() + .next_back() .map(|s| s.to_string()) .unwrap_or(url.path.to_string()), AnyPackageIdentifier::Workspace(versioned) => versioned.0.name().to_string(), diff --git a/src/cli/install.rs b/src/cli/install.rs index c0ce8df..13d6fed 100644 --- a/src/cli/install.rs +++ b/src/cli/install.rs @@ -318,7 +318,7 @@ pub async fn install( .await? .into_iter() .filter(|version| version_matches(version, &req)) - .last() + .next_back() .map(|version| (engine, version)), ) }) diff --git a/src/cli/version.rs b/src/cli/version.rs index 066136f..5ed0641 100644 --- a/src/cli/version.rs +++ b/src/cli/version.rs @@ -185,7 +185,7 @@ pub async fn get_or_download_engine( let max_matching = installed_versions .iter() .filter(|v| version_matches(v, &req)) - .last(); + .next_back(); if let Some(version) = max_matching { return Ok(path .join(version.to_string())