diff --git a/cargo-guppy/src/lib.rs b/cargo-guppy/src/lib.rs index 9b9945ed3df..192d56a041c 100644 --- a/cargo-guppy/src/lib.rs +++ b/cargo-guppy/src/lib.rs @@ -428,7 +428,7 @@ pub fn cmd_subtree_size(options: &SubtreeSizeOptions) -> Result<()> { } } - let unique_list = unique_deps.entry(package_id).or_insert_with(HashSet::new); + let unique_list = unique_deps.entry(package_id).or_default(); if unique { unique_list.insert(dep_package_id); } diff --git a/guppy/src/graph/build_targets.rs b/guppy/src/graph/build_targets.rs index 05c33a198ff..0e7d6fdfbd0 100644 --- a/guppy/src/graph/build_targets.rs +++ b/guppy/src/graph/build_targets.rs @@ -265,7 +265,7 @@ impl<'g> Eq for (dyn BuildTargetKey + 'g) {} // below. impl<'g> PartialOrd for (dyn BuildTargetKey + 'g) { fn partial_cmp(&self, other: &Self) -> Option { - self.key().partial_cmp(&other.key()) + Some(self.cmp(other)) } } diff --git a/target-spec/src/triple.rs b/target-spec/src/triple.rs index dab72ed0085..1c605cb64f6 100644 --- a/target-spec/src/triple.rs +++ b/target-spec/src/triple.rs @@ -352,7 +352,7 @@ impl Eq for TripleInner {} impl PartialOrd for TripleInner { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - self.project().partial_cmp(&other.project()) + Some(self.cmp(other)) } } diff --git a/tools/determinator/README.md b/tools/determinator/README.md index d7e3d7a4c35..126f5bd6088 100644 --- a/tools/determinator/README.md +++ b/tools/determinator/README.md @@ -69,7 +69,7 @@ file provided: The list of file changes can be obtained from a source control system such as Git. This crate provides a helper which simplifies the process of enumerating file lists while handling some gnarly edge cases. For more information, see the documentation for -[`Utf8Paths0`](crate::Utf8Paths0). +`Utf8Paths0`. These simple rules may need to be customized for particular scenarios (e.g. to ignore certain files, or mark a package changed if a file outside of it changes). For those situations, the diff --git a/tools/determinator/src/lib.rs b/tools/determinator/src/lib.rs index 78b42e6dc09..663c48b8524 100644 --- a/tools/determinator/src/lib.rs +++ b/tools/determinator/src/lib.rs @@ -70,7 +70,7 @@ //! The list of file changes can be obtained from a source control system such as Git. This crate //! provides a helper which simplifies the process of enumerating file lists while handling some //! gnarly edge cases. For more information, see the documentation for -//! [`Utf8Paths0`](crate::Utf8Paths0). +//! [`Utf8Paths0`]. //! //! These simple rules may need to be customized for particular scenarios (e.g. to ignore certain //! files, or mark a package changed if a file outside of it changes). For those situations, the diff --git a/tools/hakari/README.md b/tools/hakari/README.md index f5d0a73fac2..de888de8775 100644 --- a/tools/hakari/README.md +++ b/tools/hakari/README.md @@ -46,7 +46,7 @@ Hakari follows a three-step process. ### 1. Configuration -A [`HakariBuilder`](HakariBuilder) provides options to configure how a Hakari computation is done. Options supported +A `HakariBuilder` provides options to configure how a Hakari computation is done. Options supported include: * [the location of the `workspace-hack` package](HakariBuilder::new) * [platforms to simulate Cargo builds on](HakariBuilder::set_platforms) @@ -77,7 +77,7 @@ called to create a `Hakari` instance. The algorithm runs in three steps: This computation is done in a parallel fashion, using the [Rayon](rayon) library. -The result of this computation is a [`Hakari`](Hakari) instance. +The result of this computation is a `Hakari` instance. ### 3. Serialization @@ -101,7 +101,7 @@ The last step is to serialize the contents of the output map into the `workspace The contents outside the `BEGIN HAKARI SECTION` and `END HAKARI SECTION` lines may be edited by hand. The contents within this section are automatically generated. - On success, a [`HakariCargoToml`](HakariCargoToml) is returned. + On success, a `HakariCargoToml` is returned. 2. [`Hakari::to_toml_string`](Hakari::to_toml_string) returns the new contents of the automatically generated section. diff --git a/tools/hakari/src/lib.rs b/tools/hakari/src/lib.rs index 675101ccfec..eaba429f91b 100644 --- a/tools/hakari/src/lib.rs +++ b/tools/hakari/src/lib.rs @@ -47,7 +47,7 @@ //! //! ## 1. Configuration //! -//! A [`HakariBuilder`](HakariBuilder) provides options to configure how a Hakari computation is done. Options supported +//! A [`HakariBuilder`] provides options to configure how a Hakari computation is done. Options supported //! include: //! * [the location of the `workspace-hack` package](HakariBuilder::new) //! * [platforms to simulate Cargo builds on](HakariBuilder::set_platforms) @@ -78,7 +78,7 @@ //! //! This computation is done in a parallel fashion, using the [Rayon](rayon) library. //! -//! The result of this computation is a [`Hakari`](Hakari) instance. +//! The result of this computation is a [`Hakari`] instance. //! //! ## 3. Serialization //! @@ -102,7 +102,7 @@ //! The contents outside the `BEGIN HAKARI SECTION` and `END HAKARI SECTION` lines may be //! edited by hand. The contents within this section are automatically generated. //! -//! On success, a [`HakariCargoToml`](HakariCargoToml) is returned. +//! On success, a [`HakariCargoToml`] is returned. //! //! 2. [`Hakari::to_toml_string`](Hakari::to_toml_string) returns the new contents of the //! automatically generated section. diff --git a/tools/hakari/src/toml_out.rs b/tools/hakari/src/toml_out.rs index 0036764a4d8..f2249b81d02 100644 --- a/tools/hakari/src/toml_out.rs +++ b/tools/hakari/src/toml_out.rs @@ -448,7 +448,7 @@ pub(crate) fn write_toml( .filter_map(|&label| { // Only care about named features here. match label { - x if x == "default" => None, + "default" => None, feature_name => Some(feature_name), } })