From 2dd1c5ba7848284b31759d5dd20fbcefb2137906 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 10 May 2020 13:05:16 +0200 Subject: [PATCH] glium: write memory as pretty json, and don't warn if it is missing --- emigui_glium/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emigui_glium/src/lib.rs b/emigui_glium/src/lib.rs index dcfd94c5..8a8e86c7 100644 --- a/emigui_glium/src/lib.rs +++ b/emigui_glium/src/lib.rs @@ -181,8 +181,8 @@ pub fn read_memory(ctx: &Context, memory_json_path: impl AsRef) } } } - Err(err) => { - eprintln!("ERROR: Failed to read memory file: {}", err); + Err(_err) => { + // File probably doesn't exist. That's fine. } } } @@ -191,6 +191,6 @@ pub fn write_memory( ctx: &Context, memory_json_path: impl AsRef, ) -> Result<(), Box> { - 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(()) }