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/file_metadata.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'rust/src/file_metadata.rs') diff --git a/rust/src/file_metadata.rs b/rust/src/file_metadata.rs index 100f255b..deec36f0 100644 --- a/rust/src/file_metadata.rs +++ b/rust/src/file_metadata.rs @@ -52,7 +52,7 @@ impl FileMetadata { Self::ref_from_raw(unsafe { BNCreateFileMetadata() }) } - pub fn with_filename(name: S) -> Ref { + pub fn with_filename(name: S) -> Ref { let ret = FileMetadata::new(); ret.set_filename(name); ret @@ -75,7 +75,7 @@ impl FileMetadata { } } - pub fn set_filename(&self, name: S) { + pub fn set_filename(&self, name: S) { let name = name.to_cstr(); unsafe { @@ -107,7 +107,7 @@ impl FileMetadata { self.is_database_backed_for_view_type("") } - pub fn is_database_backed_for_view_type(&self, view_type: S) -> bool { + pub fn is_database_backed_for_view_type(&self, view_type: S) -> bool { let view_type = view_type.to_cstr(); unsafe { BNIsBackedByDatabase(self.handle, view_type.as_ref().as_ptr() as *const _) } @@ -135,14 +135,14 @@ impl FileMetadata { unsafe { BnString::into_string(BNBeginUndoActions(self.handle, anonymous_allowed)) } } - pub fn commit_undo_actions(&self, id: S) { + pub fn commit_undo_actions(&self, id: S) { let id = id.to_cstr(); unsafe { BNCommitUndoActions(self.handle, id.as_ref().as_ptr() as *const _); } } - pub fn revert_undo_actions(&self, id: S) { + pub fn revert_undo_actions(&self, id: S) { let id = id.to_cstr(); unsafe { BNRevertUndoActions(self.handle, id.as_ref().as_ptr() as *const _); @@ -169,7 +169,7 @@ impl FileMetadata { unsafe { BNGetCurrentOffset(self.handle) } } - pub fn navigate_to(&self, view: S, offset: u64) -> Result<(), ()> { + pub fn navigate_to(&self, view: S, offset: u64) -> Result<(), ()> { let view = view.to_cstr(); unsafe { @@ -181,7 +181,7 @@ impl FileMetadata { } } - pub fn view_of_type(&self, view: S) -> Option> { + pub fn view_of_type(&self, view: S) -> Option> { let view = view.to_cstr(); unsafe { @@ -226,7 +226,7 @@ impl FileMetadata { } // TODO: Pass settings? - pub fn create_database_with_progress( + pub fn create_database_with_progress( &self, file_path: impl AsRef, mut progress: P, @@ -256,7 +256,7 @@ impl FileMetadata { unsafe { BNSaveAutoSnapshot(raw_view.handle, ptr::null_mut() as *mut _) } } - pub fn open_database_for_configuration( + pub fn open_database_for_configuration( &self, filename: S, ) -> Result, ()> { @@ -273,7 +273,7 @@ impl FileMetadata { } } - pub fn open_database(&self, filename: S) -> Result, ()> { + pub fn open_database(&self, filename: S) -> Result, ()> { let filename = filename.to_cstr(); let filename_ptr = filename.as_ptr(); @@ -286,7 +286,7 @@ impl FileMetadata { } } - pub fn open_database_with_progress( + pub fn open_database_with_progress( &self, filename: S, mut progress: P, -- cgit v1.3.1