summaryrefslogtreecommitdiff
path: root/rust/src/collaboration/merge.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-05 13:17:30 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commit9dadf92c16da5cd21def79ae39ca98803c9208ec (patch)
tree3874a659bcb3818f43c1a46ab3ef081b99b47154 /rust/src/collaboration/merge.rs
parent9f5491a56f6af1fa9b030f23d40150673a52aaa1 (diff)
[Rust] Rename `AsCStr` to `IntoCStr`
Diffstat (limited to 'rust/src/collaboration/merge.rs')
-rw-r--r--rust/src/collaboration/merge.rs10
1 files changed, 5 insertions, 5 deletions
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<S: AsCStr>(&self, path: S) -> Result<BnString, ()> {
+ pub fn path_item_string<S: IntoCStr>(&self, path: S) -> Result<BnString, ()> {
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<S: AsCStr>(&self, value: S) -> Result<(), ()> {
+ pub fn success<S: IntoCStr>(&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<S: AsCStr>(&self, path_key: S) -> Option<u64> {
+ pub unsafe fn get_path_item_number<S: IntoCStr>(&self, path_key: S) -> Option<u64> {
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<S: AsCStr>(&self, path_key: S) -> Option<BnString> {
+ pub unsafe fn get_path_item_string<S: IntoCStr>(&self, path_key: S) -> Option<BnString> {
let path_key = path_key.to_cstr();
let value = unsafe {
BNAnalysisMergeConflictGetPathItemString(self.handle.as_ptr(), path_key.as_ptr())