enable if_then_some_else_none lint

This commit is contained in:
Charles Hall 2024-05-12 16:41:54 -07:00
parent bd6ea4e358
commit 52c2893073
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 27 additions and 44 deletions

View file

@ -14,7 +14,7 @@ impl service::rooms::state_compressor::Data for KeyValueDatabase {
.ok_or_else(|| Error::bad_database("State hash does not exist"))?;
let parent =
utils::u64_from_bytes(&value[0..size_of::<u64>()]).expect("bytes have right length");
let parent = if parent != 0 { Some(parent) } else { None };
let parent = (parent != 0).then_some(parent);
let mut add_mode = true;
let mut added = HashSet::new();