mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
glium: write memory as pretty json, and don't warn if it is missing
This commit is contained in:
@@ -181,8 +181,8 @@ pub fn read_memory(ctx: &Context, memory_json_path: impl AsRef<std::path::Path>)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(_err) => {
|
||||||
eprintln!("ERROR: Failed to read memory file: {}", err);
|
// File probably doesn't exist. That's fine.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,6 +191,6 @@ pub fn write_memory(
|
|||||||
ctx: &Context,
|
ctx: &Context,
|
||||||
memory_json_path: impl AsRef<std::path::Path>,
|
memory_json_path: impl AsRef<std::path::Path>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
serde_json::to_writer(std::fs::File::create(memory_json_path)?, &*ctx.memory())?;
|
serde_json::to_writer_pretty(std::fs::File::create(memory_json_path)?, &*ctx.memory())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user