syn::Item::Impl(i) => {
if let &syn::Type::Path(ref p) = &*i.self_ty {
if let Some(trait_path) = i.trait_.as_ref() {
- if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) {
+ if path_matches_nongeneric(&trait_path.1, &["core", "clone", "Clone"]) ||
+ path_matches_nongeneric(&trait_path.1, &["Clone"]) {
if let Some(full_path) = import_resolver.maybe_resolve_path(&p.path, None) {
crate_types.set_clonable("crate::".to_owned() + &full_path);
}
writeln!(header_file, "#endif").unwrap();
writeln!(cpp_header_file, "#include <string.h>\nnamespace LDK {{").unwrap();
+ // Write a few manually-defined types into the C++ header file
+ write_cpp_wrapper(&mut cpp_header_file, "Str", true, None);
+
// First parse the full crate's ASTs, caching them so that we can hold references to the AST
// objects in other datastructures:
let mut lib_src = String::new();