diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc09521a..d5765ee0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -124,7 +124,6 @@ repos: - id: cargo-test-doc - id: clippy-autofix-all - id: clippy-autofix-pedantic - - id: clippy-autofix-nursery - id: clippy-autofix-others - id: clippy-all-targets-all-features - id: stable-cargo-format diff --git a/Cargo.toml b/Cargo.toml index 96e10084..73ed88ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,12 +37,12 @@ cosmian_crypto_core = { version = "9.3.0", default-features = false, features = never = "0.1.0" tiny-keccak = { version = "2.0.2", features = ["kmac", "sha3"] } tracing = "0.1" -zeroize = "1.6.0" +zeroize = "1.7.0" [dev-dependencies] actix-rt = "2.9.0" criterion = "0.5.1" -futures = "0.3.28" +futures = "0.3.29" rand = "0.8.5" [[bench]] diff --git a/benches/BENCHMARKS.md b/benches/BENCHMARKS.md index f30ba496..333f314f 100644 --- a/benches/BENCHMARKS.md +++ b/benches/BENCHMARKS.md @@ -4,8 +4,8 @@ - [Overview](#overview) - [Benchmark Results](#benchmark-results) - - [search](#search) - - [upsert](#upsert) + - [search](#search) + - [upsert](#upsert) ## Overview @@ -17,13 +17,13 @@ This is a benchmark comparison report. | | `Searching 1 keyword(s)` | `Searching 10 keyword(s)` | `Searching 100 keyword(s)` | `Searching 1000 keyword(s)` | |:-------|:----------------------------------|:-----------------------------------|:------------------------------------|:------------------------------------- | -| | `11.18 us` (✅ **1.00x**) | `99.07 us` (❌ *8.86x slower*) | `1.01 ms` (❌ *90.42x slower*) | `10.85 ms` (❌ *970.72x slower*) | +| | `7.26 us` (✅ **1.00x**) | `60.26 us` (❌ *8.31x slower*) | `597.19 us` (❌ *82.31x slower*) | `6.02 ms` (❌ *829.65x slower*) | ### upsert | | `Upserting 10 keyword(s)` | `Upserting 100 keyword(s)` | `Upserting 1000 keyword(s)` | |:-------|:-----------------------------------|:------------------------------------|:------------------------------------- | -| | `180.68 us` (✅ **1.00x**) | `1.80 ms` (❌ *9.95x slower*) | `18.24 ms` (❌ *100.95x slower*) | +| | `113.48 us` (✅ **1.00x**) | `1.12 ms` (❌ *9.87x slower*) | `11.51 ms` (❌ *101.42x slower*) | --- Made with [criterion-table](https://github.com/nu11ptr/criterion-table) diff --git a/src/edx/mod.rs b/src/edx/mod.rs index 45d08871..c910e0a5 100644 --- a/src/edx/mod.rs +++ b/src/edx/mod.rs @@ -355,7 +355,7 @@ pub mod in_memory { } let mut res = HashMap::new(); - for (token, new_ciphertext) in new_values.into_iter() { + for (token, new_ciphertext) in new_values { let old_ciphertext = old_values.get(&token); let edx_ciphertext = edx.get(&token); diff --git a/src/findex_graph/structs.rs b/src/findex_graph/structs.rs index 8a59c074..8b6d03a5 100644 --- a/src/findex_graph/structs.rs +++ b/src/findex_graph/structs.rs @@ -13,8 +13,8 @@ pub enum IndexedValue { impl Display for IndexedValue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - IndexedValue::Pointer(keyword) => write!(f, "IndexedValue::Pointer({keyword})"), - IndexedValue::Data(location) => write!(f, "IndexedValue::Data({location})"), + Self::Pointer(keyword) => write!(f, "IndexedValue::Pointer({keyword})"), + Self::Data(location) => write!(f, "IndexedValue::Data({location})"), } } } diff --git a/src/findex_mm/structs.rs b/src/findex_mm/structs.rs index 98c63840..4ed0a82b 100644 --- a/src/findex_mm/structs.rs +++ b/src/findex_mm/structs.rs @@ -102,7 +102,7 @@ where STANDARD.encode(self.tag_hash), self.chain_token .as_ref() - .map(|token| token.to_string()) + .map(std::string::ToString::to_string) .unwrap_or_default() ) }