From 0af540175539b2ad041de802ce379fa677d49cbf Mon Sep 17 00:00:00 2001 From: Francisco Gouveia Date: Mon, 27 Jul 2026 13:35:38 +0100 Subject: [PATCH 1/2] chore: remove redundant clones --- src/bindgen/builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindgen/builder.rs b/src/bindgen/builder.rs index 74aeef1b..a5715e8d 100644 --- a/src/bindgen/builder.rs +++ b/src/bindgen/builder.rs @@ -381,7 +381,7 @@ impl Builder { result.extend_with(&parser::parse_src(x, &self.config)?); } - if let Some((lib_dir, binding_lib_name)) = self.lib.clone() { + if let Some((lib_dir, binding_lib_name)) = self.lib { let lockfile = self.lockfile.as_deref(); let cargo = Cargo::load( @@ -395,7 +395,7 @@ impl Builder { )?; result.extend_with(&parser::parse_lib(cargo, &self.config)?); - } else if let Some(cargo) = self.lib_cargo.clone() { + } else if let Some(cargo) = self.lib_cargo { result.extend_with(&parser::parse_lib(cargo, &self.config)?); } From 06fb94febde5708c8b9a3d9b57232891465e4d4a Mon Sep 17 00:00:00 2001 From: Francisco Gouveia Date: Mon, 27 Jul 2026 13:35:49 +0100 Subject: [PATCH 2/2] chore: remove redundant branch --- src/bindgen/language_backend/clike.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bindgen/language_backend/clike.rs b/src/bindgen/language_backend/clike.rs index 4d927abe..edc4a08f 100644 --- a/src/bindgen/language_backend/clike.rs +++ b/src/bindgen/language_backend/clike.rs @@ -120,10 +120,8 @@ impl<'a> CLikeLanguageBackend<'a> { let mut wrote_start_newline = false; if self.config.structure.derive_constructor(&s.annotations) && !s.fields.is_empty() { - if !wrote_start_newline { - wrote_start_newline = true; - out.new_line(); - } + wrote_start_newline = true; + out.new_line(); out.new_line();