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:
bf77ece
)
Call methods explicitly on traits to avoid to deref recursion
author
Matt Corallo
<git@bluematt.me>
Wed, 22 Sep 2021 23:15:20 +0000
(23:15 +0000)
committer
Matt Corallo
<git@bluematt.me>
Thu, 23 Sep 2021 17:49:46 +0000
(17:49 +0000)
c-bindings-gen/src/types.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/types.rs
b/c-bindings-gen/src/types.rs
index 96a4135f9c1f3800a00a4eb7239d653a9cb95879..efd6b9afcb24e48bbfef296dcb5e01984816a6b4 100644
(file)
--- a/
c-bindings-gen/src/types.rs
+++ b/
c-bindings-gen/src/types.rs
@@
-1922,7
+1922,7
@@
impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
DeclType::EnumIgnored|DeclType::StructImported if !is_ref =>
write!(w, "crate::{} {{ inner: ObjOps::heap_alloc(", decl_path).unwrap(),
DeclType::Trait(_) if is_ref => write!(w, "").unwrap(),
DeclType::EnumIgnored|DeclType::StructImported if !is_ref =>
write!(w, "crate::{} {{ inner: ObjOps::heap_alloc(", decl_path).unwrap(),
DeclType::Trait(_) if is_ref => write!(w, "").unwrap(),
- DeclType::Trait(_) if !is_ref =>
{}
,
+ DeclType::Trait(_) if !is_ref =>
write!(w, "Into::into(").unwrap()
,
_ => panic!("{:?}", decl_path),
}
});
_ => panic!("{:?}", decl_path),
}
});
@@
-1948,7
+1948,7
@@
impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
// for use when a Rust trait method returns an associated type.
// Because all of our C traits implement From<RustTypesImplementingTraits>
// we can just call .into() here and be done.
// for use when a Rust trait method returns an associated type.
// Because all of our C traits implement From<RustTypesImplementingTraits>
// we can just call .into() here and be done.
- write!(w, "
.into(
)").unwrap()
+ write!(w, ")").unwrap()
},
_ => unimplemented!(),
});
},
_ => unimplemented!(),
});