From 4382980131096754098548630805693482646547 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 17 Aug 2023 02:30:25 -0400 Subject: Rust API: Stop using NamedTypeReference::from_raw directly Now using ref_from_raw instead because you really should not have a direct reference to a bare NTR type (that doesn't make sense outside of core). --- rust/src/types.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rust/src') diff --git a/rust/src/types.rs b/rust/src/types.rs index b2c15ab8..1eabcb4b 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -470,12 +470,12 @@ impl TypeBuilder { } } - pub fn get_named_type_reference(&self) -> Result { + pub fn get_named_type_reference(&self) -> Result> { let result = unsafe { BNGetTypeBuilderNamedTypeReference(self.handle) }; if result.is_null() { Err(()) } else { - Ok(unsafe { NamedTypeReference::from_raw(result) }) + Ok(unsafe { NamedTypeReference::ref_from_raw(result) }) } } @@ -842,12 +842,12 @@ impl Type { } } - pub fn get_named_type_reference(&self) -> Result { + pub fn get_named_type_reference(&self) -> Result> { let result = unsafe { BNGetTypeNamedTypeReference(self.handle) }; if result.is_null() { Err(()) } else { - Ok(unsafe { NamedTypeReference::from_raw(result) }) + Ok(unsafe { NamedTypeReference::ref_from_raw(result) }) } } @@ -863,12 +863,12 @@ impl Type { unsafe { BNGetTypeStackAdjustment(self.handle).into() } } - pub fn registered_name(&self) -> Result { + pub fn registered_name(&self) -> Result> { let result = unsafe { BNGetRegisteredTypeName(self.handle) }; if result.is_null() { Err(()) } else { - Ok(unsafe { NamedTypeReference::from_raw(result) }) + Ok(unsafe { NamedTypeReference::ref_from_raw(result) }) } } -- cgit v1.3.1