Skip to content

Commit

Permalink
[meta] fix clippy issues on Rust 1.65
Browse files Browse the repository at this point in the history
Does require a (minor) breaking change to guppy.
sunshowers committed Nov 7, 2022
1 parent 448d830 commit e6eb541
Showing 6 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion guppy/src/errors.rs
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ pub enum Error {
message: String,

/// The summary for which the name wasn't recognized.
summary: crate::graph::summaries::ThirdPartySummary,
summary: Box<crate::graph::summaries::ThirdPartySummary>,

/// The registry name that wasn't recognized.
registry_name: String,
16 changes: 8 additions & 8 deletions guppy/src/graph/resolve.rs
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@ impl<'g> PackageSet<'g> {
direction: DependencyDirection,
mut callback: impl FnMut(PackageMetadata<'g>) -> bool,
) -> Self {
let graph = self.graph;
let graph = *self.graph;
let included: IxBitSet = self
.packages(direction)
.filter_map(move |package| {
@@ -316,7 +316,7 @@ impl<'g> PackageSet<'g> {
}
})
.collect();
Self::from_included(*graph, included)
Self::from_included(graph, included)
}

/// Partitions this `PackageSet` into two.
@@ -334,7 +334,7 @@ impl<'g> PackageSet<'g> {
direction: DependencyDirection,
mut callback: impl FnMut(PackageMetadata<'g>) -> bool,
) -> (Self, Self) {
let graph = self.graph;
let graph = *self.graph;
let mut left = IxBitSet::with_capacity(self.core.included.len());
let mut right = left.clone();

@@ -346,8 +346,8 @@ impl<'g> PackageSet<'g> {
}
});
(
Self::from_included(*graph, left),
Self::from_included(*graph, right),
Self::from_included(graph, left),
Self::from_included(graph, right),
)
}

@@ -367,7 +367,7 @@ impl<'g> PackageSet<'g> {
direction: DependencyDirection,
mut callback: impl FnMut(PackageMetadata<'g>) -> Option<bool>,
) -> (Self, Self) {
let graph = self.graph;
let graph = *self.graph;
let mut left = IxBitSet::with_capacity(self.core.included.len());
let mut right = left.clone();

@@ -380,8 +380,8 @@ impl<'g> PackageSet<'g> {
}
});
(
Self::from_included(*graph, left),
Self::from_included(*graph, right),
Self::from_included(graph, left),
Self::from_included(graph, right),
)
}

2 changes: 1 addition & 1 deletion guppy/src/graph/summaries/package_set.rs
Original file line number Diff line number Diff line change
@@ -599,7 +599,7 @@ impl<'a> PackageMatcher<'a> {
None => {
return Err(Error::UnknownRegistryName {
message: error_message.to_owned(),
summary: tp_summary.clone(),
summary: Box::new(tp_summary.clone()),
registry_name: name.clone(),
});
}
2 changes: 1 addition & 1 deletion tools/determinator/src/rules.rs
Original file line number Diff line number Diff line change
@@ -195,7 +195,7 @@ The latest version of the default rules is available
.expect("default rules should parse")
});

&*DEFAULT_RULES
&DEFAULT_RULES
}
}

5 changes: 2 additions & 3 deletions tools/hakari/src/cli_ops/workspace_ops.rs
Original file line number Diff line number Diff line change
@@ -93,9 +93,8 @@ impl<'g, 'a> WorkspaceOp<'g, 'a> {
for (rel_path, contents) in root_files {
let abs_path = workspace_root.join(rel_path.as_ref());
let parent = abs_path.parent().expect("abs path should have a parent");
std::fs::create_dir_all(&parent).map_err(|err| {
ApplyError::io("error creating directories", &parent, err)
})?;
std::fs::create_dir_all(parent)
.map_err(|err| ApplyError::io("error creating directories", parent, err))?;
write_contents(contents, &abs_path)?;
}

2 changes: 2 additions & 0 deletions tools/hakari/src/hakari.rs
Original file line number Diff line number Diff line change
@@ -86,6 +86,8 @@ impl<'g> HakariBuilder<'g> {

/// Returns the `PackageGraph` used to construct this `Hakari` instance.
pub fn graph(&self) -> &'g PackageGraph {
// This is a spurious clippy lint on Rust 1.65.0
#[allow(clippy::explicit_auto_deref)]
*self.graph
}

0 comments on commit e6eb541

Please sign in to comment.