enable manual_let_else lint

This commit is contained in:
Charles Hall 2024-05-14 17:34:43 -07:00
parent c51e87ec9a
commit 9606f59141
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
17 changed files with 165 additions and 263 deletions

View file

@ -54,12 +54,9 @@ impl service::rooms::search::Data for KeyValueDatabase {
.map(move |(key, _)| key[prefix3.len()..].to_vec())
});
let common_elements = match utils::common_elements(iterators, |a, b| {
// We compare b with a because we reversed the iterator earlier
b.cmp(a)
}) {
Some(it) => it,
None => return Ok(None),
// We compare b with a because we reversed the iterator earlier
let Some(common_elements) = utils::common_elements(iterators, |a, b| b.cmp(a)) else {
return Ok(None);
};
Ok(Some((Box::new(common_elements), words)))

View file

@ -79,13 +79,12 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
event_type: &StateEventType,
state_key: &str,
) -> Result<Option<Arc<EventId>>> {
let shortstatekey = match services()
let Some(shortstatekey) = services()
.rooms
.short
.get_shortstatekey(event_type, state_key)?
{
Some(s) => s,
None => return Ok(None),
else {
return Ok(None);
};
let full_state = services()
.rooms