From d4de2c375ef738b8f2c41d2e8c2c3a8fc0b12f59 Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Wed, 12 Jul 2023 22:45:06 +1000 Subject: [PATCH] don't fail anymore --- src/gas.rs | 1 + src/turfs/processing.rs | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gas.rs b/src/gas.rs index ba4dc21c..3f3aff95 100644 --- a/src/gas.rs +++ b/src/gas.rs @@ -95,6 +95,7 @@ impl GasArena { /// Locks the gas arena and and runs the given closure with it locked, fails if it can't acquire a lock in 30ms. /// # Panics /// if `GAS_MIXTURES` hasn't been initialized, somehow. + #[allow(unused)] pub fn with_all_mixtures_fallible(f: F) -> T where F: FnOnce(Option<&[RwLock]>) -> T, diff --git a/src/turfs/processing.rs b/src/turfs/processing.rs index bb6145fc..366583d4 100644 --- a/src/turfs/processing.rs +++ b/src/turfs/processing.rs @@ -130,8 +130,7 @@ fn process_turf( fn planet_process() { with_turf_gases_read(|arena| { - GasArena::with_all_mixtures_fallible(|all_mixtures| { - let Some(all_mixtures) = all_mixtures else {return;}; + GasArena::with_all_mixtures(|all_mixtures| { with_planetary_atmos(|map| { arena .map @@ -276,8 +275,7 @@ fn fdm( break; } with_turf_gases_read(|arena| { - GasArena::with_all_mixtures_fallible(|all_mixtures| { - let Some(all_mixtures) = all_mixtures else {return;}; + GasArena::with_all_mixtures(|all_mixtures| { let turfs_to_save = arena .map /* @@ -414,8 +412,7 @@ fn post_process() { let vis = crate::gas::visibility_copies(); with_turf_gases_read(|arena| { let processables = crate::gas::types::with_reactions(|reactions| { - GasArena::with_all_mixtures_fallible(|all_mixtures| { - let Some(all_mixtures) = all_mixtures else {return None;}; + GasArena::with_all_mixtures(|all_mixtures| { Some( arena .map