From c2d90f2e5a010546d0e1f1deeb1a6d8531ea4d4f Mon Sep 17 00:00:00 2001 From: rbran Date: Wed, 23 Apr 2025 19:24:45 +0000 Subject: [Rust] Implement custom interactive handler --- rust/src/function.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rust/src/function.rs') diff --git a/rust/src/function.rs b/rust/src/function.rs index edde15a7..e7e5e9b0 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -480,15 +480,15 @@ impl Function { /// Get the language representation of the function. /// /// * `language` - The language representation, ex. "Pseudo C". - pub fn language_representation( + pub fn language_representation( &self, - language: S, + language: &str, ) -> Option> { - let lang_name = language.into_bytes_with_nul(); + let lang_name = language.to_cstr(); let repr = unsafe { BNGetFunctionLanguageRepresentation( self.handle, - lang_name.as_ref().as_ptr() as *const c_char, + lang_name.as_ptr(), ) }; NonNull::new(repr) @@ -498,15 +498,15 @@ impl Function { /// Get the language representation of the function, if available. /// /// * `language` - The language representation, ex. "Pseudo C". - pub fn language_representation_if_available( + pub fn language_representation_if_available( &self, - language: S, + language: &str, ) -> Option> { - let lang_name = language.into_bytes_with_nul(); + let lang_name = language.to_cstr(); let repr = unsafe { BNGetFunctionLanguageRepresentationIfAvailable( self.handle, - lang_name.as_ref().as_ptr() as *const c_char, + lang_name.as_ptr(), ) }; NonNull::new(repr) -- cgit v1.3.1