From: Matt Corallo Date: Tue, 23 Jan 2024 20:00:31 +0000 (+0000) Subject: Use resolved-type matching rather than as-written in trait exposing X-Git-Tag: v0.0.121.0^2~7 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=8fc17a2e5daa8f6f7c515639d2cb7ffea5221406;p=ldk-c-bindings Use resolved-type matching rather than as-written in trait exposing --- diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 5b432d3..4572f7d 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1300,8 +1300,8 @@ fn writeln_impl(w: &mut W, w_uses: &mut HashSet {} {{\n", ident, ident).unwrap(); write!(w, "\t{} {{ inner: ObjOps::heap_alloc(Default::default()), is_owned: true }}\n", ident).unwrap(); write!(w, "}}\n").unwrap(); - } else if path_matches_nongeneric(&trait_path.1, &["core", "cmp", "PartialEq"]) { - } else if path_matches_nongeneric(&trait_path.1, &["core", "cmp", "Eq"]) { + } else if full_trait_path_opt.as_ref().map(|s| s.as_str()) == Some("core::cmp::PartialEq") { + } else if full_trait_path_opt.as_ref().map(|s| s.as_str()) == Some("core::cmp::Eq") { writeln!(w, "/// Checks if two {}s contain equal inner contents.", ident).unwrap(); writeln!(w, "/// This ignores pointers and is_owned flags and looks at the values in fields.").unwrap(); if types.c_type_has_inner_from_path(&resolved_path) { @@ -1327,7 +1327,7 @@ fn writeln_impl(w: &mut W, w_uses: &mut HashSet u64 {{\n", ident, ident).unwrap(); if types.c_type_has_inner_from_path(&resolved_path) { @@ -1347,8 +1347,8 @@ fn writeln_impl(w: &mut W, w_uses: &mut HashSet Self {{").unwrap(); writeln!(w, "\t\tSelf {{").unwrap(); @@ -1401,7 +1401,7 @@ fn writeln_impl(w: &mut W, w_uses: &mut HashSet Str {{", ident).unwrap();