diff --git a/src/entity/gateway/postgres/postgres.rs b/src/entity/gateway/postgres/postgres.rs index a8ec6fe..5a71cf5 100644 --- a/src/entity/gateway/postgres/postgres.rs +++ b/src/entity/gateway/postgres/postgres.rs @@ -1,3 +1,6 @@ +// this lint is currently bugged and suggests incorrect code https://github.com/rust-lang/rust-clippy/issues/9123 +#![allow(clippy::explicit_auto_deref)] + use std::convert::{From, TryFrom, Into}; use futures::{Future, TryStreamExt}; use async_std::stream::StreamExt; diff --git a/src/ship/drops/rare_drop_table.rs b/src/ship/drops/rare_drop_table.rs index 6631654..5d5f4c8 100644 --- a/src/ship/drops/rare_drop_table.rs +++ b/src/ship/drops/rare_drop_table.rs @@ -16,6 +16,7 @@ use crate::ship::drops::generic_weapon::AttributeTable; use crate::ship::drops::generic_armor::GenericArmorTable; use crate::ship::drops::generic_shield::GenericShieldTable; +type ItemParseFn = Box Option>; #[derive(Debug, Copy, Clone)] pub enum RareDropItem { @@ -29,7 +30,7 @@ pub enum RareDropItem { impl RareDropItem { pub fn from_string(name: String) -> RareDropItem { - let parse_funcs: [Box Option>; 6] = [ + let parse_funcs: [ItemParseFn; 6] = [ Box::new(|i| Some(RareDropItem::Weapon(str::parse::(i).ok()?))), Box::new(|i| Some(RareDropItem::Armor(str::parse::(i).ok()?))), Box::new(|i| Some(RareDropItem::Shield(str::parse::(i).ok()?))), diff --git a/src/ship/items/state.rs b/src/ship/items/state.rs index 8ce0d0d..a17da5f 100644 --- a/src/ship/items/state.rs +++ b/src/ship/items/state.rs @@ -330,7 +330,7 @@ impl<'a> ItemStateProxy<'a> { self.item_state.character_bank.extend(self.proxied_state.character_bank.clone()); self.item_state.character_room.extend(self.proxied_state.character_room.clone()); self.item_state.character_floor.extend(self.proxied_state.character_floor.clone()); - self.item_state.room_floor.extend(self.proxied_state.room_floor.clone()); + self.item_state.room_floor.extend(self.proxied_state.room_floor); } } diff --git a/src/ship/trade.rs b/src/ship/trade.rs index 6871179..311cf9e 100644 --- a/src/ship/trade.rs +++ b/src/ship/trade.rs @@ -123,7 +123,7 @@ impl TradeState { return Err(TradeStateError::MismatchedTrade(c1.client, c2.client)); } - Ok(func(&mut *c1, &mut *c2)) + Ok(func(&mut c1, &mut c2)) } // TODO: is it possible for this to not return Options?