Some clippy fixes

This commit is contained in:
Emil Ernerfeldt 2024-03-22 12:33:35 +01:00
parent b7ec3fa1e3
commit 20b0637d42
2 changed files with 5 additions and 8 deletions

View File

@ -99,11 +99,12 @@ impl crate::Storage for FileStorage {
join_handle.join().ok();
}
match std::thread::Builder::new()
let result = std::thread::Builder::new()
.name("eframe_persist".to_owned())
.spawn(move || {
save_to_disk(&file_path, &kv);
}) {
});
match result {
Ok(join_handle) => {
self.last_save_join_handle = Some(join_handle);
}

View File

@ -521,9 +521,7 @@ impl Focus {
}
}
let Some(current_focused) = self.focused_widget else {
return None;
};
let current_focused = self.focused_widget?;
// In what direction we are looking for the next widget.
let search_direction = match self.focus_direction {
@ -546,9 +544,7 @@ impl Focus {
}
});
let Some(current_rect) = self.focus_widgets_cache.get(&current_focused.id) else {
return None;
};
let current_rect = self.focus_widgets_cache.get(&current_focused.id)?;
let mut best_score = std::f32::INFINITY;
let mut best_id = None;