Skip to contentSkip to conversation

rust: qemu-macros: remove redundant clone()

PATCH In review Paolo Bonzini 2 participants 2 messages Sep 4 – Sep 21 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: qemu-macros: remove redundant clone()

This is reported by Clippy in the latest nightly builds. Take a reference instead of cloning.

---
 rust/qemu-macros/src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/qemu-macros/src/lib.rs +1 -1
index ee417bb4b4e..271125185ec 100644
@@ -261,7 +261,7 @@ macro_rules! str_to_c_str {
                 }
             },
         )?;
-        let field_ty = field.ty.clone();
+        let field_ty = &field.ty;
         let (qdev_prop, bitval) = if let Some(bitval) = bitnr {
             (
                 quote! { <#field_ty as ::hwcore::QDevProp>::BIT_INFO },
Signature · 1 line
2.55.0