Skip to content

Commit

Permalink
don't fail anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Jul 12, 2023
1 parent 65cf6f7 commit d4de2c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, F>(f: F) -> T
where
F: FnOnce(Option<&[RwLock<Mixture>]>) -> T,
Expand Down
9 changes: 3 additions & 6 deletions src/turfs/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
/*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d4de2c3

Please sign in to comment.