summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust/src/types.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs
index 1c8071e8..a39d650c 100644
--- a/rust/src/types.rs
+++ b/rust/src/types.rs
@@ -2326,9 +2326,7 @@ impl NamedTypeReference {
/// the core will do the id stuff for you.
pub fn new(type_class: NamedTypeReferenceClass, mut name: QualifiedName) -> Ref<Self> {
unsafe {
- RefCountable::inc_ref(&Self {
- handle: BNCreateNamedType(type_class, ptr::null() as *const _, &mut name.0),
- })
+ Self::ref_from_raw(BNCreateNamedType(type_class, ptr::null() as *const _, &mut name.0))
}
}
@@ -2345,9 +2343,7 @@ impl NamedTypeReference {
let type_id = type_id.into_bytes_with_nul();
unsafe {
- RefCountable::inc_ref(&Self {
- handle: BNCreateNamedType(type_class, type_id.as_ref().as_ptr() as _, &mut name.0),
- })
+ Self::ref_from_raw(BNCreateNamedType(type_class, type_id.as_ref().as_ptr() as _, &mut name.0))
}
}