refactor: rename method to avoid confusion

- rename SqliteDb::new to `_::open` as it's not return Self
lint message: methods called `new` usually return `Self`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#new_ret_no_self
- rename method `add` to `add_calgorithm`
The semantics of this has nothing to do with an `add` operation in the sense of the `Add` trait.
And method `add` can be confused for the standard trait method std::ops::Add::add
lint https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#should_implement_trait
This commit is contained in:
Gwen Lg
2025-12-14 12:17:21 +01:00
parent 5307b3f762
commit 8772db8228
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ impl Checksummer {
}
}
pub fn add(mut self, algo: Option<ChecksumAlgorithm>) -> Self {
pub fn add_algorithm(mut self, algo: Option<ChecksumAlgorithm>) -> Self {
match algo {
Some(ChecksumAlgorithm::Crc32) => {
self.crc32 = Some(new_crc32());
+1 -1
View File
@@ -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