@@ -1300,8 +1300,8 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
1300
1300
write ! ( w, "#[must_use]\n #[no_mangle]\n pub extern \" C\" fn {}_default() -> {} {{\n " , ident, ident) . unwrap ( ) ;
1301
1301
write ! ( w, "\t {} {{ inner: ObjOps::heap_alloc(Default::default()), is_owned: true }}\n " , ident) . unwrap ( ) ;
1302
1302
write ! ( w, "}}\n " ) . unwrap ( ) ;
1303
- } else if path_matches_nongeneric ( & trait_path . 1 , & [ "core" , "cmp" , " PartialEq"] ) {
1304
- } else if path_matches_nongeneric ( & trait_path . 1 , & [ "core" , "cmp" , " Eq"] ) {
1303
+ } else if full_trait_path_opt . as_ref ( ) . map ( |s| s . as_str ( ) ) == Some ( "core::cmp:: PartialEq") {
1304
+ } else if full_trait_path_opt . as_ref ( ) . map ( |s| s . as_str ( ) ) == Some ( "core::cmp:: Eq") {
1305
1305
writeln ! ( w, "/// Checks if two {}s contain equal inner contents." , ident) . unwrap ( ) ;
1306
1306
writeln ! ( w, "/// This ignores pointers and is_owned flags and looks at the values in fields." ) . unwrap ( ) ;
1307
1307
if types. c_type_has_inner_from_path ( & resolved_path) {
@@ -1327,7 +1327,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
1327
1327
types. write_from_c_conversion_suffix ( w, & ref_type, Some ( & gen_types) ) ;
1328
1328
1329
1329
writeln ! ( w, " {{ true }} else {{ false }}\n }}" ) . unwrap ( ) ;
1330
- } else if path_matches_nongeneric ( & trait_path . 1 , & [ "core" , "hash" , " Hash"] ) {
1330
+ } else if full_trait_path_opt . as_ref ( ) . map ( |s| s . as_str ( ) ) == Some ( "core::hash:: Hash") {
1331
1331
writeln ! ( w, "/// Generates a non-cryptographic 64-bit hash of the {}." , ident) . unwrap ( ) ;
1332
1332
write ! ( w, "#[no_mangle]\n pub extern \" C\" fn {}_hash(o: &{}) -> u64 {{\n " , ident, ident) . unwrap ( ) ;
1333
1333
if types. c_type_has_inner_from_path ( & resolved_path) {
@@ -1347,8 +1347,8 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
1347
1347
types. write_from_c_conversion_suffix ( w, & ref_type, Some ( & gen_types) ) ;
1348
1348
writeln ! ( w, ", &mut hasher);" ) . unwrap ( ) ;
1349
1349
writeln ! ( w, "\t core::hash::Hasher::finish(&hasher)\n }}" ) . unwrap ( ) ;
1350
- } else if ( path_matches_nongeneric ( & trait_path . 1 , & [ "core" , "clone" , " Clone"] ) || path_matches_nongeneric ( & trait_path. 1 , & [ "Clone" ] ) ) &&
1351
- types. c_type_has_inner_from_path ( & resolved_path) {
1350
+ } else if ( full_trait_path_opt . as_ref ( ) . map ( |s| s . as_str ( ) ) == Some ( "core::clone:: Clone") || path_matches_nongeneric ( & trait_path. 1 , & [ "Clone" ] ) ) &&
1351
+ types. c_type_has_inner_from_path ( & resolved_path) {
1352
1352
writeln ! ( w, "impl Clone for {} {{" , ident) . unwrap ( ) ;
1353
1353
writeln ! ( w, "\t fn clone(&self) -> Self {{" ) . unwrap ( ) ;
1354
1354
writeln ! ( w, "\t \t Self {{" ) . unwrap ( ) ;
@@ -1401,7 +1401,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
1401
1401
1402
1402
writeln ! ( w, "\t }}.into()\n }}" ) . unwrap ( ) ;
1403
1403
}
1404
- } else if path_matches_nongeneric ( & trait_path . 1 , & [ "core" , "fmt" , " Debug"] ) {
1404
+ } else if full_trait_path_opt . as_ref ( ) . map ( |s| s . as_str ( ) ) == Some ( "core::fmt:: Debug") {
1405
1405
writeln ! ( w, "/// Get a string which allows debug introspection of a {} object" , ident) . unwrap ( ) ;
1406
1406
writeln ! ( w, "pub extern \" C\" fn {}_debug_str_void(o: *const c_void) -> Str {{" , ident) . unwrap ( ) ;
1407
1407
0 commit comments