diff --git a/cargo-guppy/src/diff.rs b/cargo-guppy/src/diff.rs index 3a9ed26f555..4d9a1a2b5b0 100644 --- a/cargo-guppy/src/diff.rs +++ b/cargo-guppy/src/diff.rs @@ -123,7 +123,7 @@ impl<'a> Deref for Package<'a> { } } -impl<'a> Serialize for Package<'a> { +impl Serialize for Package<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -143,7 +143,7 @@ pub struct Diff<'a> { added: Vec<(Package<'a>, Option>>)>, } -impl<'a> ::std::fmt::Display for Diff<'a> { +impl ::std::fmt::Display for Diff<'_> { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fn write_dups( f: &mut ::std::fmt::Formatter<'_>, diff --git a/cargo-guppy/src/mv.rs b/cargo-guppy/src/mv.rs index ea9c5a171a2..44d5077763a 100644 --- a/cargo-guppy/src/mv.rs +++ b/cargo-guppy/src/mv.rs @@ -345,7 +345,7 @@ struct ManifestEdit<'g> { edit_path: Utf8PathBuf, } -impl<'g> fmt::Display for ManifestEdit<'g> { +impl fmt::Display for ManifestEdit<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, diff --git a/fixtures/src/dep_helpers.rs b/fixtures/src/dep_helpers.rs index 8f68653d582..25c4a3210b9 100644 --- a/fixtures/src/dep_helpers.rs +++ b/fixtures/src/dep_helpers.rs @@ -76,7 +76,7 @@ impl<'a> DirectionDesc<'a> { } } -impl<'a> From for DirectionDesc<'a> { +impl From for DirectionDesc<'_> { fn from(direction: DependencyDirection) -> Self { Self::new(direction) } diff --git a/guppy-summaries/src/diff.rs b/guppy-summaries/src/diff.rs index b1ceaa11561..3245cda948c 100644 --- a/guppy-summaries/src/diff.rs +++ b/guppy-summaries/src/diff.rs @@ -247,7 +247,7 @@ pub(crate) fn changed_sort_key<'a>( (status.tag(), status.latest_status(), summary_id) } -impl<'a> Serialize for PackageDiff<'a> { +impl Serialize for PackageDiff<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/guppy-summaries/src/report.rs b/guppy-summaries/src/report.rs index 0ffc219d89b..a60c5a40183 100644 --- a/guppy-summaries/src/report.rs +++ b/guppy-summaries/src/report.rs @@ -44,7 +44,7 @@ impl<'a, 'b> SummaryReport<'a, 'b> { } } -impl<'a, 'b> fmt::Display for SummaryReport<'a, 'b> { +impl fmt::Display for SummaryReport<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if !self.diff.target_packages.is_unchanged() { writeln!( @@ -84,7 +84,7 @@ impl<'x> PackageReport<'x> { } } -impl<'x> fmt::Display for PackageReport<'x> { +impl fmt::Display for PackageReport<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for (summary_id, status) in self.sorted { write!( diff --git a/guppy/src/graph/build_targets.rs b/guppy/src/graph/build_targets.rs index 0e7d6fdfbd0..3ec118772a0 100644 --- a/guppy/src/graph/build_targets.rs +++ b/guppy/src/graph/build_targets.rs @@ -235,7 +235,7 @@ pub(super) trait BuildTargetKey { fn key(&self) -> BuildTargetId; } -impl<'g> BuildTargetKey for BuildTargetId<'g> { +impl BuildTargetKey for BuildTargetId<'_> { fn key(&self) -> BuildTargetId { *self } @@ -253,23 +253,23 @@ impl<'g> Borrow for OwnedBuildTargetId { } } -impl<'g> PartialEq for (dyn BuildTargetKey + 'g) { +impl PartialEq for (dyn BuildTargetKey + '_) { fn eq(&self, other: &Self) -> bool { self.key() == other.key() } } -impl<'g> Eq for (dyn BuildTargetKey + 'g) {} +impl Eq for (dyn BuildTargetKey + '_) {} // For Borrow to be upheld, PartialOrd and Ord should be consistent. This is checked by the proptest // below. -impl<'g> PartialOrd for (dyn BuildTargetKey + 'g) { +impl PartialOrd for (dyn BuildTargetKey + '_) { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } -impl<'g> Ord for (dyn BuildTargetKey + 'g) { +impl Ord for (dyn BuildTargetKey + '_) { fn cmp(&self, other: &Self) -> Ordering { self.key().cmp(&other.key()) } diff --git a/guppy/src/graph/cargo/cargo_api.rs b/guppy/src/graph/cargo/cargo_api.rs index 1c5192395c6..bb30a0b0dfb 100644 --- a/guppy/src/graph/cargo/cargo_api.rs +++ b/guppy/src/graph/cargo/cargo_api.rs @@ -114,7 +114,7 @@ impl<'a> CargoOptions<'a> { } } -impl<'a> Default for CargoOptions<'a> { +impl Default for CargoOptions<'_> { fn default() -> Self { Self::new() } diff --git a/guppy/src/graph/cycles.rs b/guppy/src/graph/cycles.rs index 42600cad674..71402c16caf 100644 --- a/guppy/src/graph/cycles.rs +++ b/guppy/src/graph/cycles.rs @@ -269,7 +269,6 @@ use crate::{ /// [serde_github]: https://github.com/serde-rs/serde /// [serde_toml]: https://github.com/serde-rs/serde/blob/072145e0e913df7686f001dbf29e43a0ff7afac4/serde/Cargo.toml#L17-L18 /// [serde_derive_toml]: https://github.com/serde-rs/serde/blob/072145e0e913df7686f001dbf29e43a0ff7afac4/serde_derive/Cargo.toml#L29-L30 - pub struct Cycles<'g> { package_graph: &'g PackageGraph, sccs: &'g Sccs, diff --git a/guppy/src/graph/feature/feature_list.rs b/guppy/src/graph/feature/feature_list.rs index 2e89403dd45..9fb4c9fb91d 100644 --- a/guppy/src/graph/feature/feature_list.rs +++ b/guppy/src/graph/feature/feature_list.rs @@ -113,7 +113,7 @@ impl<'g> FeatureList<'g> { } } -impl<'g> fmt::Debug for FeatureList<'g> { +impl fmt::Debug for FeatureList<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("FeatureList") .field("package", self.package.id()) @@ -182,7 +182,7 @@ impl<'g, 'a> Iter<'g, 'a> { } } -impl<'g, 'a> Iterator for Iter<'g, 'a> { +impl<'g> Iterator for Iter<'g, '_> { type Item = FeatureId<'g>; fn next(&mut self) -> Option { @@ -198,7 +198,7 @@ impl<'g, 'a> Iterator for Iter<'g, 'a> { #[derive(Clone, Copy)] pub struct DisplayFeatures<'g, 'a>(&'a [FeatureLabel<'g>]); -impl<'g, 'a> fmt::Display for DisplayFeatures<'g, 'a> { +impl fmt::Display for DisplayFeatures<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let len = self.0.len(); for (idx, label) in self.0.iter().enumerate() { @@ -211,7 +211,7 @@ impl<'g, 'a> fmt::Display for DisplayFeatures<'g, 'a> { } } -impl<'g, 'a> fmt::Debug for DisplayFeatures<'g, 'a> { +impl fmt::Debug for DisplayFeatures<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Use the Display impl as the debug one because it's easier to read. write!(f, "{}", self) diff --git a/guppy/src/graph/feature/graph_impl.rs b/guppy/src/graph/feature/graph_impl.rs index 80be4753473..15a6f0c75a6 100644 --- a/guppy/src/graph/feature/graph_impl.rs +++ b/guppy/src/graph/feature/graph_impl.rs @@ -528,7 +528,7 @@ impl<'g> From<(&'g PackageId, FeatureLabel<'g>)> for FeatureId<'g> { /// "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/dep:bar" /// ); /// ``` -impl<'g> fmt::Display for FeatureId<'g> { +impl fmt::Display for FeatureId<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}/{}", self.package_id, self.label) } @@ -552,7 +552,7 @@ pub enum FeatureLabel<'g> { OptionalDependency(&'g str), } -impl<'g> FeatureLabel<'g> { +impl FeatureLabel<'_> { /// Returns the kind of feature this is. /// /// The kind of a feature is simply the enum variant without any associated data. @@ -581,8 +581,7 @@ impl<'g> FeatureLabel<'g> { /// assert_eq!(format!("{}", FeatureLabel::Named("foo")), "foo"); /// assert_eq!(format!("{}", FeatureLabel::OptionalDependency("bar")), "dep:bar"); /// ``` - -impl<'g> fmt::Display for FeatureLabel<'g> { +impl fmt::Display for FeatureLabel<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Base => write!(f, "[base]"), diff --git a/guppy/src/graph/feature/query.rs b/guppy/src/graph/feature/query.rs index c7d9d94bab7..f473098d86c 100644 --- a/guppy/src/graph/feature/query.rs +++ b/guppy/src/graph/feature/query.rs @@ -37,7 +37,7 @@ pub trait FeatureFilter<'g> { fn accept(&mut self, graph: &FeatureGraph<'g>, feature_id: FeatureId<'g>) -> bool; } -impl<'g, 'a, T> FeatureFilter<'g> for &'a mut T +impl<'g, T> FeatureFilter<'g> for &mut T where T: FeatureFilter<'g>, { @@ -46,13 +46,13 @@ where } } -impl<'g, 'a> FeatureFilter<'g> for Box + 'a> { +impl<'g> FeatureFilter<'g> for Box + '_> { fn accept(&mut self, graph: &FeatureGraph<'g>, feature_id: FeatureId<'g>) -> bool { (**self).accept(graph, feature_id) } } -impl<'g, 'a> FeatureFilter<'g> for &'a mut dyn FeatureFilter<'g> { +impl<'g> FeatureFilter<'g> for &mut dyn FeatureFilter<'g> { fn accept(&mut self, graph: &FeatureGraph<'g>, feature_id: FeatureId<'g>) -> bool { (**self).accept(graph, feature_id) } @@ -348,7 +348,7 @@ pub trait FeatureResolver<'g> { fn accept(&mut self, query: &FeatureQuery<'g>, link: ConditionalLink<'g>) -> bool; } -impl<'g, 'a, T> FeatureResolver<'g> for &'a mut T +impl<'g, T> FeatureResolver<'g> for &mut T where T: FeatureResolver<'g>, { @@ -357,13 +357,13 @@ where } } -impl<'g, 'a> FeatureResolver<'g> for Box + 'a> { +impl<'g> FeatureResolver<'g> for Box + '_> { fn accept(&mut self, query: &FeatureQuery<'g>, link: ConditionalLink<'g>) -> bool { (**self).accept(query, link) } } -impl<'g, 'a> FeatureResolver<'g> for &'a mut dyn FeatureResolver<'g> { +impl<'g> FeatureResolver<'g> for &mut dyn FeatureResolver<'g> { fn accept(&mut self, query: &FeatureQuery<'g>, link: ConditionalLink<'g>) -> bool { (**self).accept(query, link) } diff --git a/guppy/src/graph/feature/resolve.rs b/guppy/src/graph/feature/resolve.rs index 94be0104fd6..359b8fa757d 100644 --- a/guppy/src/graph/feature/resolve.rs +++ b/guppy/src/graph/feature/resolve.rs @@ -70,7 +70,7 @@ pub struct FeatureSet<'g> { core: ResolveCore, } -impl<'g> fmt::Debug for FeatureSet<'g> { +impl fmt::Debug for FeatureSet<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_set() .entries(self.packages_with_features(DependencyDirection::Forward)) @@ -605,11 +605,11 @@ impl<'g> FeatureSet<'g> { } } -impl<'g> PartialEq for FeatureSet<'g> { +impl PartialEq for FeatureSet<'_> { fn eq(&self, other: &Self) -> bool { ::std::ptr::eq(self.graph.package_graph, other.graph.package_graph) && self.core == other.core } } -impl<'g> Eq for FeatureSet<'g> {} +impl Eq for FeatureSet<'_> {} diff --git a/guppy/src/graph/feature/weak.rs b/guppy/src/graph/feature/weak.rs index 10de992d4ac..bc5ea2118fe 100644 --- a/guppy/src/graph/feature/weak.rs +++ b/guppy/src/graph/feature/weak.rs @@ -135,7 +135,7 @@ pub(super) enum SingleBufferState<'g> { Accepted, } -impl<'g> Default for SingleBufferState<'g> { +impl Default for SingleBufferState<'_> { fn default() -> Self { Self::Buffered(SingleBufferVec::new()) } diff --git a/guppy/src/graph/graph_impl.rs b/guppy/src/graph/graph_impl.rs index be4e478a29b..5653bc8d4e3 100644 --- a/guppy/src/graph/graph_impl.rs +++ b/guppy/src/graph/graph_impl.rs @@ -695,7 +695,7 @@ pub struct PackageMetadata<'g> { inner: &'g PackageMetadataImpl, } -impl<'g> fmt::Debug for PackageMetadata<'g> { +impl fmt::Debug for PackageMetadata<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("PackageMetadata") .field("package_id", &self.id().repr()) @@ -1168,7 +1168,7 @@ pub(crate) enum FeatureIndexInPackage { } /// `PackageMetadata`'s `PartialEq` implementation uses pointer equality for the `PackageGraph`. -impl<'g> PartialEq for PackageMetadata<'g> { +impl PartialEq for PackageMetadata<'_> { fn eq(&self, other: &Self) -> bool { // Checking for the same package ix is enough as each package is guaranteed to be a 1:1 map // with ixs. @@ -1176,7 +1176,7 @@ impl<'g> PartialEq for PackageMetadata<'g> { } } -impl<'g> Eq for PackageMetadata<'g> {} +impl Eq for PackageMetadata<'_> {} #[derive(Clone, Debug)] pub(crate) struct PackageMetadataImpl { @@ -1326,7 +1326,7 @@ impl<'g> PackageSource<'g> { } } -impl<'g> fmt::Display for PackageSource<'g> { +impl fmt::Display for PackageSource<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { PackageSource::Workspace(path) => write!(f, "{}", path), @@ -1551,7 +1551,7 @@ impl<'g> ExternalSource<'g> { /// "git+https://github.com/rust-lang/cargo.git?branch=main#0227f048fcb7c798026ede6cc20c92befc84c3a4", /// ); /// ``` -impl<'g> fmt::Display for ExternalSource<'g> { +impl fmt::Display for ExternalSource<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { ExternalSource::Registry(url) => write!(f, "{}{}", Self::REGISTRY_PLUS, url), diff --git a/guppy/src/graph/resolve.rs b/guppy/src/graph/resolve.rs index 413afda450a..e1ec0f5dcf7 100644 --- a/guppy/src/graph/resolve.rs +++ b/guppy/src/graph/resolve.rs @@ -543,13 +543,13 @@ impl<'g> PackageSet<'g> { } } -impl<'g> PartialEq for PackageSet<'g> { +impl PartialEq for PackageSet<'_> { fn eq(&self, other: &Self) -> bool { ::std::ptr::eq(self.graph.0, other.graph.0) && self.core == other.core } } -impl<'g> Eq for PackageSet<'g> {} +impl Eq for PackageSet<'_> {} /// Represents whether a particular link within a package graph should be followed during a /// resolve operation. @@ -561,7 +561,7 @@ pub trait PackageResolver<'g> { fn accept(&mut self, query: &PackageQuery<'g>, link: PackageLink<'g>) -> bool; } -impl<'g, 'a, T> PackageResolver<'g> for &'a mut T +impl<'g, T> PackageResolver<'g> for &mut T where T: PackageResolver<'g>, { @@ -570,13 +570,13 @@ where } } -impl<'g, 'a> PackageResolver<'g> for Box + 'a> { +impl<'g> PackageResolver<'g> for Box + '_> { fn accept(&mut self, query: &PackageQuery<'g>, link: PackageLink<'g>) -> bool { (**self).accept(query, link) } } -impl<'g, 'a> PackageResolver<'g> for &'a mut dyn PackageResolver<'g> { +impl<'g> PackageResolver<'g> for &mut dyn PackageResolver<'g> { fn accept(&mut self, query: &PackageQuery<'g>, link: PackageLink<'g>) -> bool { (**self).accept(query, link) } diff --git a/guppy/src/graph/resolve_core.rs b/guppy/src/graph/resolve_core.rs index 10f6908d69a..f3ee3e2d7ed 100644 --- a/guppy/src/graph/resolve_core.rs +++ b/guppy/src/graph/resolve_core.rs @@ -271,7 +271,7 @@ pub(super) struct Topo<'g, G: GraphSpec> { remaining: usize, } -impl<'g, G: GraphSpec> Iterator for Topo<'g, G> { +impl Iterator for Topo<'_, G> { type Item = NodeIndex; fn next(&mut self) -> Option { @@ -290,7 +290,7 @@ impl<'g, G: GraphSpec> Iterator for Topo<'g, G> { } } -impl<'g, G: GraphSpec> ExactSizeIterator for Topo<'g, G> { +impl ExactSizeIterator for Topo<'_, G> { fn len(&self) -> usize { self.remaining } @@ -306,7 +306,7 @@ pub(super) struct Links<'g, G: GraphSpec> { direction: DependencyDirection, } -impl<'g, G: GraphSpec> Iterator for Links<'g, G> { +impl Iterator for Links<'_, G> { #[allow(clippy::type_complexity)] type Item = (NodeIndex, NodeIndex, EdgeIndex); diff --git a/guppy/src/graph/summaries.rs b/guppy/src/graph/summaries.rs index 0cd6ba77b03..e838d66227d 100644 --- a/guppy/src/graph/summaries.rs +++ b/guppy/src/graph/summaries.rs @@ -21,7 +21,7 @@ pub use package_set::*; use serde::{Deserialize, Serialize}; use std::collections::BTreeSet; -impl<'g> CargoSet<'g> { +impl CargoSet<'_> { /// Creates a build summary with the given options. /// /// Requires the `summaries` feature to be enabled. @@ -112,7 +112,7 @@ impl PackageGraph { } } -impl<'g> PackageMetadata<'g> { +impl PackageMetadata<'_> { /// Converts this metadata to a `SummaryId`. /// /// Requires the `summaries` feature to be enabled. @@ -287,7 +287,7 @@ pub struct FeaturesOnlySummary { pub optional_deps: BTreeSet, } -impl<'g> PackageSource<'g> { +impl PackageSource<'_> { /// Converts a `PackageSource` into a `SummarySource`. /// /// Requires the `summaries` feature to be enabled. @@ -306,7 +306,7 @@ impl<'g> PackageSource<'g> { } } -impl<'g> PartialEq for PackageSource<'g> { +impl PartialEq for PackageSource<'_> { fn eq(&self, summary_source: &SummarySource) -> bool { match summary_source { SummarySource::Workspace { workspace_path } => { diff --git a/guppy/src/graph/summaries/package_set.rs b/guppy/src/graph/summaries/package_set.rs index d6bd430f461..65c0b21418a 100644 --- a/guppy/src/graph/summaries/package_set.rs +++ b/guppy/src/graph/summaries/package_set.rs @@ -125,7 +125,7 @@ pub struct PackageSetSummary { pub third_party: Vec, } -impl<'g> PackageSet<'g> { +impl PackageSet<'_> { /// Converts this `PackageSet` to a serializable [`PackageSetSummary`]. pub fn to_summary(&self) -> PackageSetSummary { PackageSetSummary::new(self) @@ -323,7 +323,7 @@ pub enum GitReqSummary { Default, } -impl<'g> GitReq<'g> { +impl GitReq<'_> { /// Converts `self` into a [`GitReqSummary`]. /// /// Requires the `summaries` feature to be enabled. diff --git a/guppy/src/petgraph_support/dfs.rs b/guppy/src/petgraph_support/dfs.rs index f83dd48c18e..5d5e70f5887 100644 --- a/guppy/src/petgraph_support/dfs.rs +++ b/guppy/src/petgraph_support/dfs.rs @@ -58,7 +58,7 @@ where fn filter(&mut self, edge: G::EdgeRef) -> Self::Iter; } -impl<'a, G, T> BufferedEdgeFilter for &'a mut T +impl BufferedEdgeFilter for &mut T where T: BufferedEdgeFilter, G: IntoEdges, diff --git a/guppy/src/petgraph_support/dot.rs b/guppy/src/petgraph_support/dot.rs index b87949ef82c..7767759c8cd 100644 --- a/guppy/src/petgraph_support/dot.rs +++ b/guppy/src/petgraph_support/dot.rs @@ -45,7 +45,7 @@ where } } -impl<'a, NR, ER, T> DotVisitor for &'a T +impl DotVisitor for &T where T: DotVisitor, { @@ -155,7 +155,7 @@ impl<'a, 'b> DotWrite<'a, 'b> { } } -impl<'a, 'b> Write for DotWrite<'a, 'b> { +impl Write for DotWrite<'_, '_> { fn write_str(&mut self, s: &str) -> fmt::Result { for c in s.chars() { self.write_char(c)?; diff --git a/guppy/src/petgraph_support/scc.rs b/guppy/src/petgraph_support/scc.rs index 8a947e6c672..9394377cf66 100644 --- a/guppy/src/petgraph_support/scc.rs +++ b/guppy/src/petgraph_support/scc.rs @@ -135,7 +135,7 @@ pub(crate) struct NodeIter<'a, Ix> { direction: Direction, } -impl<'a, Ix> NodeIter<'a, Ix> { +impl NodeIter<'_, Ix> { /// Returns the direction this iteration is happening in. #[allow(dead_code)] pub fn direction(&self) -> Direction { @@ -143,7 +143,7 @@ impl<'a, Ix> NodeIter<'a, Ix> { } } -impl<'a, Ix: IndexType> Iterator for NodeIter<'a, Ix> { +impl Iterator for NodeIter<'_, Ix> { type Item = NodeIndex; fn next(&mut self) -> Option> { diff --git a/guppy/src/platform/platform_eval.rs b/guppy/src/platform/platform_eval.rs index d72427fb0ab..da48f6ce3ae 100644 --- a/guppy/src/platform/platform_eval.rs +++ b/guppy/src/platform/platform_eval.rs @@ -159,7 +159,7 @@ pub struct PlatformEval<'g> { assert_covariant!(PlatformEval); -impl<'g> PlatformEval<'g> { +impl PlatformEval<'_> { /// Runs this evaluator against the given platform. pub fn eval(&self, platform: &Platform) -> EnabledTernary { let mut res = EnabledTernary::Disabled; diff --git a/internal-tools/cargo-compare/src/diff.rs b/internal-tools/cargo-compare/src/diff.rs index a8acbc6f97b..92938d18b39 100644 --- a/internal-tools/cargo-compare/src/diff.rs +++ b/internal-tools/cargo-compare/src/diff.rs @@ -87,7 +87,7 @@ impl<'g> TargetHostDiff<'g> { } } -impl<'g> fmt::Display for TargetHostDiff<'g> { +impl fmt::Display for TargetHostDiff<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, @@ -105,14 +105,14 @@ pub struct FeatureDiff<'g> { pub verbose: bool, } -impl<'g> FeatureDiff<'g> { +impl FeatureDiff<'_> { /// Returns true if there's a diff. pub fn any_diff(&self) -> bool { self.a.diff(&self.b).is_change() } } -impl<'g> fmt::Display for FeatureDiff<'g> { +impl fmt::Display for FeatureDiff<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.a.diff(&self.b) { edit::Edit::Change(diff) => { diff --git a/target-spec/src/platform.rs b/target-spec/src/platform.rs index 361345e7d2d..dcfd7915930 100644 --- a/target-spec/src/platform.rs +++ b/target-spec/src/platform.rs @@ -178,7 +178,6 @@ impl Platform { /// let platform = Platform::new("armv5te-apple-darwin", TargetFeatures::Unknown).unwrap(); /// assert!(platform.is_heuristic()); /// ``` - pub fn is_heuristic(&self) -> bool { self.triple.is_heuristic() } diff --git a/tools/cargo-hakari/src/publish.rs b/tools/cargo-hakari/src/publish.rs index 9670b9e732c..182acf80824 100644 --- a/tools/cargo-hakari/src/publish.rs +++ b/tools/cargo-hakari/src/publish.rs @@ -127,7 +127,7 @@ impl<'g> TempRemoveDep<'g> { } } -impl<'g> Drop for TempRemoveDep<'g> { +impl Drop for TempRemoveDep<'_> { fn drop(&mut self) { // Ignore errors in this impl. let _ = self.finish(false); @@ -141,7 +141,7 @@ struct TempRemoveDepInner<'g> { output: OutputContext, } -impl<'g> TempRemoveDepInner<'g> { +impl TempRemoveDepInner<'_> { fn finish(self, success: bool) -> Result<()> { let package_set = self.package.to_package_set(); let add_ops = self diff --git a/tools/hakari/src/cli_ops/workspace_ops.rs b/tools/hakari/src/cli_ops/workspace_ops.rs index 8585ebd7122..833e02169a8 100644 --- a/tools/hakari/src/cli_ops/workspace_ops.rs +++ b/tools/hakari/src/cli_ops/workspace_ops.rs @@ -87,7 +87,7 @@ pub(crate) enum WorkspaceOp<'g, 'a> { }, } -impl<'g, 'a> WorkspaceOp<'g, 'a> { +impl<'g> WorkspaceOp<'g, '_> { fn apply(&self, canonical_workspace_root: &Utf8Path) -> Result<(), ApplyError> { match self { WorkspaceOp::NewCrate { @@ -571,7 +571,7 @@ impl<'g, 'a, 'ops> WorkspaceOpsDisplay<'g, 'a, 'ops> { } } -impl<'g, 'a, 'ops> fmt::Display for WorkspaceOpsDisplay<'g, 'a, 'ops> { +impl fmt::Display for WorkspaceOpsDisplay<'_, '_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let workspace_root = self.ops.graph.workspace().root(); let workspace_root_manifest = workspace_root.join("Cargo.toml"); diff --git a/tools/hakari/src/explain/display.rs b/tools/hakari/src/explain/display.rs index 940dbabae92..8ceeac61943 100644 --- a/tools/hakari/src/explain/display.rs +++ b/tools/hakari/src/explain/display.rs @@ -48,7 +48,7 @@ impl<'g, 'a, 'explain> HakariExplainDisplay<'g, 'a, 'explain> { const DITTO_MARK: &str = "\""; -impl<'g, 'a, 'explain> fmt::Display for HakariExplainDisplay<'g, 'a, 'explain> { +impl fmt::Display for HakariExplainDisplay<'_, '_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut table = Table::new(" {:^} | {:^} {:^} {:^}"); // header row @@ -186,7 +186,7 @@ struct FeatureDisplay<'g, 'a> { features: &'a BTreeSet<&'g str>, } -impl<'g, 'a> fmt::Display for FeatureDisplay<'g, 'a> { +impl fmt::Display for FeatureDisplay<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.features.is_empty() { return write!(f, "(no features)"); diff --git a/tools/hakari/src/explain/simplify.rs b/tools/hakari/src/explain/simplify.rs index 7f9bf82b17d..be26df3d297 100644 --- a/tools/hakari/src/explain/simplify.rs +++ b/tools/hakari/src/explain/simplify.rs @@ -20,7 +20,7 @@ impl Simple { &'simple self, star_style: &'simple Style, display_fn: F, - ) -> SimpleDisplay<'_, T, F> + ) -> SimpleDisplay<'simple, T, F> where F: Fn(&T, &mut fmt::Formatter) -> fmt::Result, { @@ -40,7 +40,7 @@ pub(super) struct SimpleDisplay<'simple, T, F> { } #[cfg(feature = "cli-support")] -impl<'simple, T, F> fmt::Display for SimpleDisplay<'simple, T, F> +impl fmt::Display for SimpleDisplay<'_, T, F> where F: Fn(&T, &mut fmt::Formatter) -> fmt::Result, { diff --git a/tools/hakari/src/helpers.rs b/tools/hakari/src/helpers.rs index 7b5f727eead..7d0e059304b 100644 --- a/tools/hakari/src/helpers.rs +++ b/tools/hakari/src/helpers.rs @@ -28,7 +28,7 @@ impl<'a> VersionDisplay<'a> { } } -impl<'a> fmt::Display for VersionDisplay<'a> { +impl fmt::Display for VersionDisplay<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if !self.exact_versions && self.version.pre.is_empty() { // Minimal versions permitted, so attempt to minimize the version. diff --git a/tools/hakari/src/summaries.rs b/tools/hakari/src/summaries.rs index b742e820bf7..b4eca8444c4 100644 --- a/tools/hakari/src/summaries.rs +++ b/tools/hakari/src/summaries.rs @@ -196,7 +196,7 @@ impl HakariBuilderSummary { } } -impl<'g> HakariBuilder<'g> { +impl HakariBuilder<'_> { /// Converts this `HakariBuilder` to a serializable summary. /// /// Requires the `cli-support` feature to be enabled. diff --git a/tools/hakari/src/verify/display.rs b/tools/hakari/src/verify/display.rs index c13f4185879..03fa2c92d16 100644 --- a/tools/hakari/src/verify/display.rs +++ b/tools/hakari/src/verify/display.rs @@ -33,7 +33,7 @@ impl<'g, 'verify> VerifyErrorsDisplay<'g, 'verify> { } } -impl<'g, 'verify> fmt::Display for VerifyErrorsDisplay<'g, 'verify> { +impl fmt::Display for VerifyErrorsDisplay<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for explain in self.verify.errors() { writeln!(