mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-04 12:22:55 +00:00
chore: un-allow clippy's "readonly_write_lock" (#5862)
This commit is contained in:
@@ -77,7 +77,6 @@ clippy.print_stdout = "warn"
|
||||
clippy.print_stderr = "warn"
|
||||
clippy.dbg_macro = "warn"
|
||||
clippy.implicit_clone = "warn"
|
||||
clippy.readonly_write_lock = "allow"
|
||||
rust.unknown_lints = "deny"
|
||||
rust.unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
||||
|
||||
|
||||
@@ -114,7 +114,13 @@ impl TxnService for RaftEngineBackend {
|
||||
} = txn.into();
|
||||
|
||||
let mut succeeded = true;
|
||||
|
||||
// Here we are using the write lock to guard against parallel access inside "txn", and
|
||||
// outside "get" or "put" etc. It doesn't serve the purpose of mutating some Rust data, so
|
||||
// the variable is not "mut". Suppress the clippy warning because of this.
|
||||
#[allow(clippy::readonly_write_lock)]
|
||||
let engine = self.engine.write().unwrap();
|
||||
|
||||
for cmp in compare {
|
||||
let existing_value = engine_get(&engine, &cmp.key)?.map(|kv| kv.value);
|
||||
if !cmp.compare_value(existing_value.as_ref()) {
|
||||
|
||||
Reference in New Issue
Block a user