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/command.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rust/src/command.rs') diff --git a/rust/src/command.rs b/rust/src/command.rs index 721f9170..099eafa8 100644 --- a/rust/src/command.rs +++ b/rust/src/command.rs @@ -42,7 +42,7 @@ use std::os::raw::c_void; use crate::binary_view::BinaryView; use crate::function::Function; -use crate::string::AsCStr; +use crate::string::IntoCStr; /// The trait required for generic commands. See [register_command] for example usage. pub trait Command: 'static + Sync { @@ -95,7 +95,7 @@ where /// ``` pub fn register_command(name: S, desc: S, command: C) where - S: AsCStr, + S: IntoCStr, C: Command, { extern "C" fn cb_action(ctxt: *mut c_void, view: *mut BNBinaryView) @@ -196,7 +196,7 @@ where /// ``` pub fn register_command_for_address(name: S, desc: S, command: C) where - S: AsCStr, + S: IntoCStr, C: AddressCommand, { extern "C" fn cb_action(ctxt: *mut c_void, view: *mut BNBinaryView, addr: u64) @@ -298,7 +298,7 @@ where /// ``` pub fn register_command_for_range(name: S, desc: S, command: C) where - S: AsCStr, + S: IntoCStr, C: RangeCommand, { extern "C" fn cb_action(ctxt: *mut c_void, view: *mut BNBinaryView, addr: u64, len: u64) @@ -405,7 +405,7 @@ where /// ``` pub fn register_command_for_function(name: S, desc: S, command: C) where - S: AsCStr, + S: IntoCStr, C: FunctionCommand, { extern "C" fn cb_action(ctxt: *mut c_void, view: *mut BNBinaryView, func: *mut BNFunction) -- cgit v1.3.1