Clippy fixes

This commit is contained in:
mdecimus
2025-01-11 11:43:45 +01:00
parent dc19f20285
commit 3612d5fc5d
67 changed files with 131 additions and 140 deletions

View File

@@ -179,7 +179,7 @@ impl HttpStore {
if entry_key.len() > self.config.max_entry_size {
break;
}
} else if index_value.map_or(false, |v| col_num == v) {
} else if index_value.is_some_and(|v| col_num == v) {
entry_value.push(ch);
if entry_value.len() > self.config.max_entry_size {
break;

View File

@@ -402,6 +402,6 @@ impl IsActiveStore for Config {
fn is_active_in_memory_store(&self, id: &str) -> bool {
self.value("storage.lookup")
.map_or(false, |store_id| store_id == id)
.is_some_and(|store_id| store_id == id)
}
}

View File

@@ -184,7 +184,7 @@ impl Store {
pub async fn write(&self, batch: Batch) -> trc::Result<AssignedIds> {
#[cfg(feature = "test_mode")]
if std::env::var("PARANOID_WRITE").map_or(false, |v| v == "1") {
if std::env::var("PARANOID_WRITE").is_ok_and(|v| v == "1") {
let mut account_id = u32::MAX;
let mut collection = u8::MAX;
let mut document_id = u32::MAX;

View File

@@ -296,7 +296,7 @@ impl Store {
bm.insert(*document_id);
} else if position_candidates
.get(document_id)
.map_or(false, |positions| {
.is_some_and(|positions| {
postings.matches_positions(positions, pos as u32)
})
{
@@ -360,7 +360,7 @@ impl Store {
bm.insert(document_id);
} else if position_candidates
.get(&document_id)
.map_or(false, |positions| {
.is_some_and(|positions| {
postings.matches_positions(positions, pos as u32)
})
{