Relaxed clippy fixes/nits (#2661)

This PR contains just a few clippy fixes and nits, which are, however,
relaxed by workspace clippy settings here:
https://github.com/paritytech/polkadot-sdk/blob/master/Cargo.toml#L483-L506

---------

Co-authored-by: Dmitry Sinyavin <dmitry.sinyavin@parity.io>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Branislav Kontur
2023-12-18 13:18:30 +01:00
committed by GitHub
parent a250652b3b
commit d941784b39
44 changed files with 76 additions and 106 deletions
+3 -1
View File
@@ -101,7 +101,9 @@ pub trait Database<H: Clone + AsRef<[u8]>>: Send + Sync {
/// This may be faster than `get` since it doesn't allocate.
/// Use `with_get` helper function if you need `f` to return a value from `f`
fn with_get(&self, col: ColumnId, key: &[u8], f: &mut dyn FnMut(&[u8])) {
self.get(col, key).map(|v| f(&v));
if let Some(v) = self.get(col, key) {
f(&v)
}
}
/// Check if database supports internal ref counting for state data.