projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50e5555
)
Use `Clone::clone(a)` rather than `a.clone` to avoid deref recursion
author
Matt Corallo
<git@bluematt.me>
Sat, 24 Dec 2022 22:57:17 +0000
(22:57 +0000)
committer
Matt Corallo
<git@bluematt.me>
Sat, 24 Dec 2022 22:59:55 +0000
(22:59 +0000)
c-bindings-gen/src/main.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/main.rs
b/c-bindings-gen/src/main.rs
index 02aa72fdc46c2c36241f270b3e9b547df47ee49b..0e9a42286a1434ef6a8e3ea4f8c60356277c658e 100644
(file)
--- a/
c-bindings-gen/src/main.rs
+++ b/
c-bindings-gen/src/main.rs
@@
-1779,7
+1779,7
@@
fn writeln_enum<'a, 'b, W: std::io::Write>(w: &mut W, e: &'a syn::ItemEnum, type
};
if $ref || new_var {
if $ref {
- write!(w, "let mut {}_nonref =
(*{}).clone(
);\n\t\t\t\t", $field_ident, $field_ident).unwrap();
+ write!(w, "let mut {}_nonref =
Clone::clone({}
);\n\t\t\t\t", $field_ident, $field_ident).unwrap();
if new_var {
let nonref_ident = format_ident!("{}_nonref", $field_ident);
if $to_c {