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())