Skip to content

Commit f4d96c7

Browse files
authored
Fix clippy linting (#115)
* Fix clippy (This was fixed via `cargo clippy --fix`) * Fmt
1 parent 923ca65 commit f4d96c7

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/compressor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl<'a> Compressor<'a> {
156156
) -> Compressor<'a> {
157157
let levels = level_info
158158
.iter()
159-
.map(|l| Level::restore((*l).max_length, (*l).current_chain_length, (*l).head))
159+
.map(|l| Level::restore(l.max_length, l.current_chain_length, l.head))
160160
.collect();
161161

162162
let mut compressor = Compressor {

src/database.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,9 @@ fn load_map_from_db(
237237
let mut missing_sgs: Vec<_> = state_group_map
238238
.iter()
239239
.filter_map(|(_sg, entry)| {
240-
if let Some(prev_sg) = entry.prev_state_group {
241-
if state_group_map.contains_key(&prev_sg) {
242-
None
243-
} else {
244-
Some(prev_sg)
245-
}
246-
} else {
247-
None
248-
}
240+
entry
241+
.prev_state_group
242+
.filter(|&prev_sg| !state_group_map.contains_key(&prev_sg))
249243
})
250244
.collect();
251245

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ pub fn continue_run(
563563
let (state_group_map, max_group_found) =
564564
database::reload_data_from_db(db_url, room_id, start, Some(chunk_size), level_info)?;
565565

566-
let original_num_rows = state_group_map.iter().map(|(_, v)| v.state_map.len()).sum();
566+
let original_num_rows = state_group_map.values().map(|v| v.state_map.len()).sum();
567567

568568
// Now we actually call the compression algorithm.
569569
let compressor = Compressor::compress_from_save(&state_group_map, level_info);

0 commit comments

Comments
 (0)