Skip to content

Commit

Permalink
style: Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 22, 2022
1 parent 0c24866 commit f78d389
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/bin/upgrade/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
let mut reason = None;

let dep_key = dep_key.get();
let dependency = match Dependency::from_toml(&manifest_path, dep_key, dep_item) {
let dependency = match Dependency::from_toml(manifest_path, dep_key, dep_item) {
Ok(dependency) => dependency,
Err(err) => {
shell_warn(&format!("ignoring {}, unsupported entry: {}", dep_key, err))?;
Expand Down Expand Up @@ -271,7 +271,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
// we're offline.
let registry_url = dependency
.registry()
.map(|registry| registry_url(&manifest_path, Some(registry)))
.map(|registry| registry_url(manifest_path, Some(registry)))
.transpose()?;
if !args.offline {
if let Some(registry_url) = &registry_url {
Expand All @@ -286,7 +286,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
get_compatible_dependency(
&dependency.name,
&old_version_req,
&manifest_path,
manifest_path,
registry_url.as_ref(),
)
.ok()
Expand All @@ -300,7 +300,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
let latest_version = get_latest_dependency(
&dependency.name,
is_prerelease,
&manifest_path,
manifest_path,
registry_url.as_ref(),
)
.map(|d| {
Expand Down Expand Up @@ -470,6 +470,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
//
// Reusing updates (resolve_ws) so we know what lock_version to reference
for (name, (req, precise)) in &precise_deps {
#[allow(clippy::unnecessary_lazy_evaluations)] // requires 1.62
for lock_version in locked
.iter()
.filter(|p| p.name == **name)
Expand Down
7 changes: 4 additions & 3 deletions src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ impl LocalManifest {
}

/// Allow mutating depedencies, wherever they live
pub fn get_dependency_tables_mut<'r>(
&'r mut self,
) -> impl Iterator<Item = &mut dyn toml_edit::TableLike> + 'r {
pub fn get_dependency_tables_mut(
&mut self,
) -> impl Iterator<Item = &mut dyn toml_edit::TableLike> + '_ {
let root = self.data.as_table_mut();
root.iter_mut().flat_map(|(k, v)| {
if DepTable::KINDS
Expand Down Expand Up @@ -385,6 +385,7 @@ fn remove_feature_activation(
.filter_map(|(idx, feature_activation)| {
if let toml_edit::Value::String(feature_activation) = feature_activation {
let activation = feature_activation.value();
#[allow(clippy::unnecessary_lazy_evaluations)] // requires 1.62
match status {
FeatureStatus::None => activation == dep || activation.starts_with(dep_feature),
FeatureStatus::DepFeature => activation == dep,
Expand Down

0 comments on commit f78d389

Please sign in to comment.