mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-30 11:50:38 +00:00
chore: un-allow clippy's "readonly_write_lock" (#5862)
This commit is contained in:
@@ -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