Skip to content

Commit 971569b

Browse files
committed
[bindings] Handle ::-containing paths in generics
Specifically, this is required for some paths which use `Option<msgs::Message>`.
1 parent 697eede commit 971569b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

c-bindings-gen/src/types.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,11 +1946,7 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
19461946
if !self.write_c_path_intern(w, &$p_arg.path, generics, true, true, true) { return false; }
19471947
}
19481948
} else {
1949-
if $p_arg.path.segments.len() == 1 {
1950-
write!(w, "{}", $p_arg.path.segments.iter().next().unwrap().ident).unwrap();
1951-
} else {
1952-
return false;
1953-
}
1949+
write!(w, "{}", $p_arg.path.segments.last().unwrap().ident).unwrap();
19541950
}
19551951
} else if self.is_known_container(&subtype, is_ref) || self.is_transparent_container(&subtype, is_ref) {
19561952
if !self.write_c_mangled_container_path_intern(w, Self::path_to_generic_args(&$p_arg.path), generics,

0 commit comments

Comments
 (0)