mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Use a lot more let-else (#7582)
This commit is contained in:
@@ -193,12 +193,11 @@ impl crate::Storage for FileStorage {
|
||||
fn save_to_disk(file_path: &PathBuf, kv: &HashMap<String, String>) {
|
||||
profiling::function_scope!();
|
||||
|
||||
if let Some(parent_dir) = file_path.parent() {
|
||||
if !parent_dir.exists() {
|
||||
if let Err(err) = std::fs::create_dir_all(parent_dir) {
|
||||
log::warn!("Failed to create directory {parent_dir:?}: {err}");
|
||||
}
|
||||
}
|
||||
if let Some(parent_dir) = file_path.parent()
|
||||
&& !parent_dir.exists()
|
||||
&& let Err(err) = std::fs::create_dir_all(parent_dir)
|
||||
{
|
||||
log::warn!("Failed to create directory {parent_dir:?}: {err}");
|
||||
}
|
||||
|
||||
match std::fs::File::create(file_path) {
|
||||
|
||||
Reference in New Issue
Block a user