From 9dadf92c16da5cd21def79ae39ca98803c9208ec Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 5 May 2025 13:17:30 -0400 Subject: [Rust] Rename `AsCStr` to `IntoCStr` --- rust/src/metadata.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rust/src/metadata.rs') diff --git a/rust/src/metadata.rs b/rust/src/metadata.rs index b6b3ce61..2ccd9d52 100644 --- a/rust/src/metadata.rs +++ b/rust/src/metadata.rs @@ -1,5 +1,5 @@ use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Guard, Ref, RefCountable}; -use crate::string::{AsCStr, BnString, IntoJson}; +use crate::string::{BnString, IntoCStr, IntoJson}; use binaryninjacore_sys::*; use std::collections::HashMap; use std::os::raw::c_char; @@ -267,7 +267,7 @@ impl Metadata { Ok(Some(unsafe { Self::ref_from_raw(ptr) })) } - pub fn get(&self, key: S) -> Result>, ()> { + pub fn get(&self, key: S) -> Result>, ()> { if self.get_type() != MetadataType::KeyValueDataType { return Err(()); } @@ -287,7 +287,7 @@ impl Metadata { Ok(()) } - pub fn insert(&self, key: S, value: &Metadata) -> Result<(), ()> { + pub fn insert(&self, key: S, value: &Metadata) -> Result<(), ()> { if self.get_type() != MetadataType::KeyValueDataType { return Err(()); } @@ -305,7 +305,7 @@ impl Metadata { Ok(()) } - pub fn remove_key(&self, key: S) -> Result<(), ()> { + pub fn remove_key(&self, key: S) -> Result<(), ()> { if self.get_type() != MetadataType::KeyValueDataType { return Err(()); } @@ -424,7 +424,7 @@ impl From<&Array> for Ref { } } -impl From>> for Ref { +impl From>> for Ref { fn from(value: HashMap>) -> Self { let data: Vec<(S::Result, Ref)> = value.into_iter().map(|(k, v)| (k.to_cstr(), v)).collect(); @@ -443,7 +443,7 @@ impl From>> for Ref { impl From<&[(S, T)]> for Ref where - S: AsCStr + Copy, + S: IntoCStr + Copy, for<'a> &'a T: Into>, { fn from(value: &[(S, T)]) -> Self { @@ -464,7 +464,7 @@ where impl From<[(S, T); N]> for Ref where - S: AsCStr + Copy, + S: IntoCStr + Copy, for<'a> &'a T: Into>, { fn from(value: [(S, T); N]) -> Self { @@ -518,7 +518,7 @@ impl From<&Vec> for Ref { } } -impl From> for Ref { +impl From> for Ref { fn from(value: Vec) -> Self { let mut refs = vec![]; for v in value { -- cgit v1.3.1