diff --git a/world/src/sim/diffusion.rs b/world/src/sim/diffusion.rs index 875d0b6556..c810532d36 100644 --- a/world/src/sim/diffusion.rs +++ b/world/src/sim/diffusion.rs @@ -421,7 +421,7 @@ pub fn tridag(a: &[f64], b: &[f64], c: &[f64], r: &[f64], u: &mut [f64], n: usiz gam = vec![Default::default(); n]; - assert!(b[0] != 0.0); + assert_ne!(b[0], 0.0); /* ! first pass @@ -443,7 +443,7 @@ pub fn tridag(a: &[f64], b: &[f64], c: &[f64], r: &[f64], u: &mut [f64], n: usiz for j in 1..n { gam[j] = c[j - 1] / bet; bet = b[j] - a[j] * gam[j]; - assert!(bet != 0.0); + assert_ne!(bet, 0.0); // Round 0: u[0] = r[0] / b[0] // = r'[0] / b'[0] // Round j: u[j] = (r[j] - a[j] * u'[j - 1]) / b'[j] diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index adf35652de..e94cd40fb1 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -1063,9 +1063,9 @@ fn erode( let mut h_stack = vec![Zero::zero(); dh.len()]; let mut b_stack = vec![Zero::zero(); dh.len()]; let mut area_stack = vec![Zero::zero(); dh.len()]; - assert!(mstack.len() == dh.len()); - assert!(b.len() == dh.len()); - assert!(h_t.len() == dh.len()); + assert_eq!(mstack.len(), dh.len()); + assert_eq!(b.len(), dh.len()); + assert_eq!(h_t.len(), dh.len()); let mstack_inv = &mut *mstack_inv; mstack.iter().enumerate().for_each(|(stacki, &posi)| { let posi = posi as usize; @@ -1472,7 +1472,7 @@ fn erode( .into_par_iter() .enumerate() .for_each(|(posi, (&stacki, h))| { - assert!(posi == mstack[stacki] as usize); + assert_eq!(posi, mstack[stacki] as usize); *h = h_stack[stacki]; }); @@ -2270,7 +2270,7 @@ pub fn get_lakes( _ => {}, } }); - assert!(rcv != -1); + assert_ne!(rcv, -1); downhill[node] = rcv; tag[node] = Tag::WithRcv; }