Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy #12667

Merged
merged 6 commits into from
Sep 14, 2023
Merged

Clippy #12667

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove most clone where clippy::clone_on_copy
  • Loading branch information
Eh2406 committed Sep 13, 2023
commit afe5333d86632a887090b8a220885004f464cb95
14 changes: 6 additions & 8 deletions src/cargo/core/compiler/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,16 +1037,16 @@ impl Fingerprint {
for (a, b) in self.deps.iter().zip(old.deps.iter()) {
if a.name != b.name {
return DirtyReason::UnitDependencyNameChanged {
old: b.name.clone(),
new: a.name.clone(),
old: b.name,
new: a.name,
};
}

if a.fingerprint.hash_u64() != b.fingerprint.hash_u64() {
return DirtyReason::UnitDependencyInfoChanged {
new_name: a.name.clone(),
new_name: a.name,
new_fingerprint: a.fingerprint.hash_u64(),
old_name: b.name.clone(),
old_name: b.name,
old_fingerprint: b.fingerprint.hash_u64(),
};
}
Expand Down Expand Up @@ -1122,9 +1122,7 @@ impl Fingerprint {
| FsStatus::StaleItem(_)
| FsStatus::StaleDependency { .. }
| FsStatus::StaleDepFingerprint { .. } => {
self.fs_status = FsStatus::StaleDepFingerprint {
name: dep.name.clone(),
};
self.fs_status = FsStatus::StaleDepFingerprint { name: dep.name };
return Ok(());
}
};
Expand Down Expand Up @@ -1166,7 +1164,7 @@ impl Fingerprint {
);

self.fs_status = FsStatus::StaleDependency {
name: dep.name.clone(),
name: dep.name,
dep_mtime: *dep_mtime,
max_mtime: *max_mtime,
};
Expand Down
8 changes: 4 additions & 4 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,8 @@ impl TomlProfile {
self.codegen_units = Some(v);
}

if let Some(v) = &profile.debug {
self.debug = Some(v.clone());
if let Some(v) = profile.debug {
self.debug = Some(v);
}

if let Some(v) = profile.debug_assertions {
Expand Down Expand Up @@ -1978,7 +1978,7 @@ impl TomlManifest {
)
}
}
Some(rust_version.clone())
Some(rust_version)
} else {
None
};
Expand Down Expand Up @@ -2358,7 +2358,7 @@ impl TomlManifest {
.categories
.as_ref()
.map(|_| MaybeWorkspace::Defined(metadata.categories.clone()));
package.rust_version = rust_version.clone().map(|rv| MaybeWorkspace::Defined(rv));
package.rust_version = rust_version.map(|rv| MaybeWorkspace::Defined(rv));
package.exclude = package
.exclude
.as_ref()
Expand Down