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 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'examples3d') 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; -- cgit