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/sync.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'rust/src/collaboration/sync.rs') diff --git a/rust/src/collaboration/sync.rs b/rust/src/collaboration/sync.rs index 5afb8923..b1b26982 100644 --- a/rust/src/collaboration/sync.rs +++ b/rust/src/collaboration/sync.rs @@ -11,7 +11,7 @@ use crate::file_metadata::FileMetadata; use crate::progress::{NoProgressCallback, ProgressCallback}; use crate::project::file::ProjectFile; use crate::rc::Ref; -use crate::string::{raw_to_string, AsCStr, BnString}; +use crate::string::{raw_to_string, BnString, IntoCStr}; use crate::type_archive::{TypeArchive, TypeArchiveMergeConflict}; // TODO: PathBuf @@ -43,7 +43,7 @@ pub fn default_file_path(file: &RemoteFile) -> Result { /// /// * `file` - Remote File to download and open /// * `db_path` - File path for saved database -pub fn download_file(file: &RemoteFile, db_path: S) -> Result, ()> { +pub fn download_file(file: &RemoteFile, db_path: S) -> Result, ()> { download_file_with_progress(file, db_path, NoProgressCallback) } @@ -54,7 +54,7 @@ pub fn download_file(file: &RemoteFile, db_path: S) -> Result( +pub fn download_file_with_progress( file: &RemoteFile, db_path: S, mut progress: F, @@ -220,7 +220,7 @@ pub fn get_local_snapshot_for_remote( pub fn download_database(file: &RemoteFile, location: S, force: bool) -> Result<(), ()> where - S: AsCStr, + S: IntoCStr, { download_database_with_progress(file, location, force, NoProgressCallback) } @@ -232,7 +232,7 @@ pub fn download_database_with_progress( mut progress: F, ) -> Result<(), ()> where - S: AsCStr, + S: IntoCStr, F: ProgressCallback, { let db_path = location.to_cstr(); @@ -475,7 +475,7 @@ pub fn get_snapshot_author( /// * `database` - Parent database /// * `snapshot` - Snapshot to edit /// * `author` - Target author -pub fn set_snapshot_author( +pub fn set_snapshot_author( database: &Database, snapshot: &Snapshot, author: S, @@ -650,7 +650,7 @@ pub fn get_remote_file_for_local_type_archive(database: &TypeArchive) -> Option< } /// Get the remote snapshot associated with a local snapshot (if it exists) in a Type Archive -pub fn get_remote_snapshot_from_local_type_archive( +pub fn get_remote_snapshot_from_local_type_archive( type_archive: &TypeArchive, snapshot_id: S, ) -> Option> { @@ -679,7 +679,7 @@ pub fn get_local_snapshot_from_remote_type_archive( } /// Test if a snapshot is ignored from the archive -pub fn is_type_archive_snapshot_ignored( +pub fn is_type_archive_snapshot_ignored( type_archive: &TypeArchive, snapshot_id: S, ) -> bool { @@ -694,7 +694,7 @@ pub fn is_type_archive_snapshot_ignored( /// Download a type archive from its remote, saving all snapshots to an archive in the /// specified `location`. Returns a [`TypeArchive`] for using later. -pub fn download_type_archive( +pub fn download_type_archive( file: &RemoteFile, location: S, ) -> Result>, ()> { @@ -703,7 +703,7 @@ pub fn download_type_archive( /// Download a type archive from its remote, saving all snapshots to an archive in the /// specified `location`. Returns a [`TypeArchive`] for using later. -pub fn download_type_archive_with_progress( +pub fn download_type_archive_with_progress( file: &RemoteFile, location: S, mut progress: F, -- cgit v1.3.1