From db136939810cbc52d516f6ff37e03b4d49212e4d Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Sat, 9 Nov 2024 23:12:25 +1100 Subject: [PATCH] clippy daddio --- crates/auxmacros/src/lib.rs | 2 +- src/gas/types.rs | 6 +++--- src/reaction.rs | 2 +- src/turfs.rs | 2 +- src/turfs/katmos.rs | 13 ++++++------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/auxmacros/src/lib.rs b/crates/auxmacros/src/lib.rs index b18d51ad..cefba569 100644 --- a/crates/auxmacros/src/lib.rs +++ b/crates/auxmacros/src/lib.rs @@ -32,7 +32,7 @@ fn strip_mut_and_filter(arg: &syn::FnArg) -> Option { ///#[auxmacros::generate_simd_functions] ///#[byondapi::bind("/proc/process_atmos_callbacks")] ///fn atmos_callback_handle(remaining: ByondValue) -> Result { -/// auxcallback::callback_processing_hook(remaining) +/// auxcallback::callback_processing_hook(remaining) ///} /// ``` #[proc_macro_attribute] diff --git a/src/gas/types.rs b/src/gas/types.rs index 3491534b..e1c90d78 100644 --- a/src/gas/types.rs +++ b/src/gas/types.rs @@ -216,7 +216,7 @@ static GAS_SPECIFIC_HEATS: RwLock>> = const_rwlock(None); #[byondapi::init] pub fn initialize_gas_info_structs() { - *GAS_INFO_BY_STRING.write() = Some(DashMap::with_hasher(FxBuildHasher::default())); + *GAS_INFO_BY_STRING.write() = Some(DashMap::with_hasher(FxBuildHasher)); *GAS_INFO_BY_IDX.write() = Some(Vec::new()); *GAS_SPECIFIC_HEATS.write() = Some(Vec::new()); } @@ -429,8 +429,8 @@ fn finalize_gas_refs() -> Result { } thread_local! { - static CACHED_GAS_IDS: RefCell> = RefCell::new(HashMap::with_hasher(FxBuildHasher::default())); - static CACHED_IDX_TO_STRINGS: RefCell, FxBuildHasher>> = RefCell::new(HashMap::with_hasher(FxBuildHasher::default())); + static CACHED_GAS_IDS: RefCell> = const { RefCell::new(HashMap::with_hasher(FxBuildHasher)) }; + static CACHED_IDX_TO_STRINGS: RefCell, FxBuildHasher>> = const { RefCell::new(HashMap::with_hasher(FxBuildHasher)) }; } /// Returns the appropriate index to be used by auxmos for a given ID string. diff --git a/src/reaction.rs b/src/reaction.rs index 4639febd..1eb9211f 100644 --- a/src/reaction.rs +++ b/src/reaction.rs @@ -92,7 +92,7 @@ impl Reaction { let id = { let mut state = rustc_hash::FxHasher::default(); string_id.as_bytes().hash(&mut state); - state.finish() as u64 + state.finish() }; let our_reaction = { diff --git a/src/turfs.rs b/src/turfs.rs index 40b74f3c..5ba7a0bc 100644 --- a/src/turfs.rs +++ b/src/turfs.rs @@ -376,7 +376,7 @@ pub fn initialize_turfs() { // double that for edges since each turf can have up to 6 edges but eehhhh *TURF_GASES.write() = Some(TurfGases { graph: StableDiGraph::with_capacity(650_250, 1_300_500), - map: IndexMap::with_capacity_and_hasher(650_250, FxBuildHasher::default()), + map: IndexMap::with_capacity_and_hasher(650_250, FxBuildHasher), }); *PLANETARY_ATMOS.write() = Some(Default::default()); } diff --git a/src/turfs/katmos.rs b/src/turfs/katmos.rs index a9dc0d23..a64f10ca 100644 --- a/src/turfs/katmos.rs +++ b/src/turfs/katmos.rs @@ -712,13 +712,12 @@ fn send_pressure_differences( drop(sender.try_send(Box::new(move || { let turf = ByondValue::new_ref(ValueType::Turf, cur_turf); let other_turf = ByondValue::new_ref(ValueType::Turf, adj_turf); - Ok(turf - .call_id( - byond_string!("consider_pressure_difference"), - &[other_turf, amt.into()], - ) - .map(|_| ()) - .wrap_err("Katmos considering pressure differences")?) + turf.call_id( + byond_string!("consider_pressure_difference"), + &[other_turf, amt.into()], + ) + .map(|_| ()) + .wrap_err("Katmos considering pressure differences") }))); } }