From 9b4548e3edca25e13b6a0f3b3b0066e17c159d15 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 16 Feb 2024 16:05:11 +0100 Subject: [PATCH] fixup Signed-off-by: Oliver Tale-Yazdi --- src/cmd/transpose/lift_to_workspace.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cmd/transpose/lift_to_workspace.rs b/src/cmd/transpose/lift_to_workspace.rs index 0630b0e..6b84f22 100644 --- a/src/cmd/transpose/lift_to_workspace.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -106,7 +106,7 @@ impl LiftToWorkspaceCmd { dep: &str, fixers: &mut Map, AutoFixer)>, ) -> Result<(), String> { - let by_version = self.build_version_index(&meta, dep); + let by_version = Self::build_version_index(meta, dep); let versions = by_version.keys().collect::>(); let best_version = self.find_best_version(g, dep, &versions, &by_version)?; @@ -149,14 +149,12 @@ impl LiftToWorkspaceCmd { dep.req = best_version.parse().unwrap(); // We always add `default-features = false` into the workspace: workspace_fixer.add_workspace_dep(&dep, false)?; - Ok(()) } /// Index what versions of a crate are used in the workspace. fn build_version_index( - &self, meta: &cargo_metadata::Metadata, name: &str, ) -> HashMap> { @@ -177,7 +175,7 @@ impl LiftToWorkspaceCmd { &self, g: &GlobalArgs, name: &str, - versions: &Vec<&VersionReq>, + versions: &[&VersionReq], by_version: &HashMap>, ) -> Result { let found = match self.version_resolver {