diff --git a/src/api/common/signature/checksum.rs b/src/api/common/signature/checksum.rs index 4ae6a18b..88d72347 100644 --- a/src/api/common/signature/checksum.rs +++ b/src/api/common/signature/checksum.rs @@ -122,7 +122,7 @@ impl Checksummer { } } - pub fn add(mut self, algo: Option) -> Self { + pub fn add_algorithm(mut self, algo: Option) -> Self { match algo { Some(ChecksumAlgorithm::Crc32) => { self.crc32 = Some(new_crc32()); diff --git a/src/api/common/signature/streaming.rs b/src/api/common/signature/streaming.rs index 64362727..06b551eb 100644 --- a/src/api/common/signature/streaming.rs +++ b/src/api/common/signature/streaming.rs @@ -60,7 +60,7 @@ pub fn parse_streaming_body( request_trailer_checksum_algorithm(req.headers())? .ok_or_bad_request("Missing x-amz-trailer header")?, ); - checksummer = checksummer.add(algo); + checksummer = checksummer.add_algorithm(algo); algo } else { None diff --git a/src/api/s3/copy.rs b/src/api/s3/copy.rs index baec1fef..33a0cdd1 100644 --- a/src/api/s3/copy.rs +++ b/src/api/s3/copy.rs @@ -545,7 +545,7 @@ pub async fn handle_upload_part_copy( // Now, actually copy the blocks let mut checksummer = Checksummer::init(&Default::default(), !dest_encryption.is_encrypted()) - .add(dest_object_checksum_algorithm.map(|(algo, _)| algo)); + .add_algorithm(dest_object_checksum_algorithm.map(|(algo, _)| algo)); // First, create a stream that is able to read the source blocks // and extract the subrange if necessary. diff --git a/src/api/s3/put.rs b/src/api/s3/put.rs index 588b6aa7..dbe063ed 100644 --- a/src/api/s3/put.rs +++ b/src/api/s3/put.rs @@ -158,7 +158,7 @@ pub(crate) async fn save_stream> + Unpin>( let mut checksummer = match &checksum_mode { ChecksumMode::Verify(expected) => Checksummer::init(expected, !encryption.is_encrypted()), ChecksumMode::Calculate(algo) => { - Checksummer::init(&Default::default(), !encryption.is_encrypted()).add(*algo) + Checksummer::init(&Default::default(), !encryption.is_encrypted()).add_algorithm(*algo) } ChecksumMode::VerifyFrom { .. } => { // Checksums are calculated by the garage_api_common::signature module diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs index 80fa00f5..832dab14 100644 --- a/src/db/sqlite_adapter.rs +++ b/src/db/sqlite_adapter.rs @@ -23,7 +23,7 @@ pub use rusqlite; pub(crate) fn open_db(path: &PathBuf, opt: &OpenOpt) -> Result { info!("Opening Sqlite database at: {}", path.display()); let manager = r2d2_sqlite::SqliteConnectionManager::file(path); - SqliteDb::new(manager, opt.fsync) + SqliteDb::open(manager, opt.fsync) } // ---- @@ -62,7 +62,7 @@ pub struct SqliteDb { } impl SqliteDb { - pub fn new(manager: SqliteConnectionManager, sync_mode: bool) -> Result { + pub fn open(manager: SqliteConnectionManager, sync_mode: bool) -> Result { let manager = manager.with_init(move |db| { db.pragma_update(None, "journal_mode", "WAL")?; if sync_mode { diff --git a/src/db/test.rs b/src/db/test.rs index 977dc965..46e12bb5 100644 --- a/src/db/test.rs +++ b/src/db/test.rs @@ -145,7 +145,7 @@ fn test_sqlite_db() { use crate::sqlite_adapter::SqliteDb; let manager = r2d2_sqlite::SqliteConnectionManager::memory(); - let db = SqliteDb::new(manager, false).unwrap(); + let db = SqliteDb::open(manager, false).unwrap(); test_suite(db); }