Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Feb 16, 2024
1 parent 464ab80 commit 9b4548e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cmd/transpose/lift_to_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl LiftToWorkspaceCmd {
dep: &str,
fixers: &mut Map<String, (Option<Package>, 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::<Vec<_>>();
let best_version = self.find_best_version(g, dep, &versions, &by_version)?;

Expand Down Expand Up @@ -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<VersionReq, Vec<(Package, Dep)>> {
Expand All @@ -177,7 +175,7 @@ impl LiftToWorkspaceCmd {
&self,
g: &GlobalArgs,
name: &str,
versions: &Vec<&VersionReq>,
versions: &[&VersionReq],
by_version: &HashMap<VersionReq, Vec<(Package, Dep)>>,
) -> Result<String, String> {
let found = match self.version_resolver {
Expand Down

0 comments on commit 9b4548e

Please sign in to comment.