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/collaboration/merge.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rust/src/collaboration/merge.rs') diff --git a/rust/src/collaboration/merge.rs b/rust/src/collaboration/merge.rs index 2fb5b3de..9ebf4cda 100644 --- a/rust/src/collaboration/merge.rs +++ b/rust/src/collaboration/merge.rs @@ -4,7 +4,7 @@ use std::ptr::NonNull; use crate::database::{snapshot::Snapshot, Database}; use crate::file_metadata::FileMetadata; use crate::rc::{CoreArrayProvider, CoreArrayProviderInner, Guard, Ref, RefCountable}; -use crate::string::{AsCStr, BnString}; +use crate::string::{BnString, IntoCStr}; pub type MergeConflictDataType = BNMergeConflictDataType; @@ -48,7 +48,7 @@ impl MergeConflict { NonNull::new(result).map(|handle| unsafe { Snapshot::from_raw(handle) }) } - pub fn path_item_string(&self, path: S) -> Result { + pub fn path_item_string(&self, path: S) -> Result { let path = path.to_cstr(); let result = unsafe { BNAnalysisMergeConflictGetPathItemString(self.handle.as_ptr(), path.as_ptr()) @@ -119,7 +119,7 @@ impl MergeConflict { } /// Call this when you've resolved the conflict to save the result - pub fn success(&self, value: S) -> Result<(), ()> { + pub fn success(&self, value: S) -> Result<(), ()> { let value = value.to_cstr(); let success = unsafe { BNAnalysisMergeConflictSuccess(self.handle.as_ptr(), value.as_ptr()) }; @@ -127,7 +127,7 @@ impl MergeConflict { } // TODO: Make a safe version of this that checks the path and if it holds a number - pub unsafe fn get_path_item_number(&self, path_key: S) -> Option { + pub unsafe fn get_path_item_number(&self, path_key: S) -> Option { let path_key = path_key.to_cstr(); let value = unsafe { BNAnalysisMergeConflictGetPathItem(self.handle.as_ptr(), path_key.as_ptr()) }; @@ -138,7 +138,7 @@ impl MergeConflict { } } - pub unsafe fn get_path_item_string(&self, path_key: S) -> Option { + pub unsafe fn get_path_item_string(&self, path_key: S) -> Option { let path_key = path_key.to_cstr(); let value = unsafe { BNAnalysisMergeConflictGetPathItemString(self.handle.as_ptr(), path_key.as_ptr()) -- cgit v1.3.1