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

Fix new clippy warnings on Rust 1.78.0 #2065

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,12 +1280,12 @@ impl CargoOptions {
let mut args_from_pyproject = Vec::new();

if self.manifest_path.is_none() && tool_maturin.manifest_path.is_some() {
self.manifest_path = tool_maturin.manifest_path.clone();
self.manifest_path.clone_from(&tool_maturin.manifest_path);
args_from_pyproject.push("manifest-path");
}

if self.profile.is_none() && tool_maturin.profile.is_some() {
self.profile = tool_maturin.profile.clone();
self.profile.clone_from(&tool_maturin.profile);
args_from_pyproject.push("profile");
}

Expand Down
2 changes: 1 addition & 1 deletion src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn compile_target(

// Add linked_paths to build artifacts
for artifact in artifacts.values_mut() {
artifact.linked_paths = linked_paths.clone();
artifact.linked_paths.clone_from(&linked_paths);
}

let status = cargo_build
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
after_help = "Visit https://maturin.rs to learn more about maturin.",
styles = cargo_options::styles(),
)]
#[cfg_attr(clippy, allow(clippy::large_enum_variant))]
#[allow(clippy::large_enum_variant)]
/// Build and publish crates with pyo3, cffi and uniffi bindings as well
/// as rust binaries as python packages
enum Opt {
Expand Down
16 changes: 8 additions & 8 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Metadata23 {
) -> Result<()> {
let pyproject_dir = pyproject_dir.as_ref();
if let Some(project) = &pyproject_toml.project {
self.name = project.name.clone();
self.name.clone_from(&project.name);

if let Some(version) = &project.version {
self.version = version.clone();
Expand Down Expand Up @@ -173,7 +173,7 @@ impl Metadata23 {
if let Some(description) = text {
self.description = Some(description.clone());
}
self.description_content_type = content_type.clone();
self.description_content_type.clone_from(content_type);
}
None => {}
}
Expand Down Expand Up @@ -279,15 +279,15 @@ impl Metadata23 {
}

if let Some(classifiers) = &project.classifiers {
self.classifiers = classifiers.clone();
self.classifiers.clone_from(classifiers);
}

if let Some(urls) = &project.urls {
self.project_url = urls.clone();
self.project_url.clone_from(urls);
}

if let Some(dependencies) = &project.dependencies {
self.requires_dist = dependencies.clone();
self.requires_dist.clone_from(dependencies);
}

if let Some(dependencies) = &project.optional_dependencies {
Expand All @@ -313,10 +313,10 @@ impl Metadata23 {
}

if let Some(scripts) = &project.scripts {
self.scripts = scripts.clone();
self.scripts.clone_from(scripts);
}
if let Some(gui_scripts) = &project.gui_scripts {
self.gui_scripts = gui_scripts.clone();
self.gui_scripts.clone_from(gui_scripts);
}
if let Some(entry_points) = &project.entry_points {
// Raise error on ambiguous entry points: https://www.python.org/dev/peps/pep-0621/#entry-points
Expand All @@ -326,7 +326,7 @@ impl Metadata23 {
if entry_points.contains_key("gui_scripts") {
bail!("gui_scripts is not allowed in project.entry-points table");
}
self.entry_points = entry_points.clone();
self.entry_points.clone_from(entry_points);
}
}
Ok(())
Expand Down