From 34b0d51455cbeba16dd5bacb451e476efb591518 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 6 Mar 2022 23:00:07 +0100 Subject: Don’t track the state.bin file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples3d/debug_deserialize3.rs | 12 +++++++++++- state.bin | Bin 16369 -> 0 bytes 2 files changed, 11 insertions(+), 1 deletion(-) delete mode 100644 state.bin diff --git a/examples3d/debug_deserialize3.rs b/examples3d/debug_deserialize3.rs index 6de4c76..b8b79fb 100644 --- a/examples3d/debug_deserialize3.rs +++ b/examples3d/debug_deserialize3.rs @@ -18,7 +18,17 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - let bytes = std::fs::read("state.bin").unwrap(); + let path = "state.bin"; + let bytes = match std::fs::read(path) { + Ok(bytes) => bytes, + Err(err) => { + println!( + "Failed to open the serialzed scene file {:?}: {}", + path, err + ); + return; + } + }; match bincode::deserialize(&bytes) { Ok(state) => { let state: PhysicsState = state; diff --git a/state.bin b/state.bin deleted file mode 100644 index beb406a..0000000 Binary files a/state.bin and /dev/null differ -- cgit