new rust version new clippy lints
This commit is contained in:
parent
91a92870dc
commit
36261663be
@ -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 std::convert::{From, TryFrom, Into};
|
||||||
use futures::{Future, TryStreamExt};
|
use futures::{Future, TryStreamExt};
|
||||||
use async_std::stream::StreamExt;
|
use async_std::stream::StreamExt;
|
||||||
|
@ -16,6 +16,7 @@ use crate::ship::drops::generic_weapon::AttributeTable;
|
|||||||
use crate::ship::drops::generic_armor::GenericArmorTable;
|
use crate::ship::drops::generic_armor::GenericArmorTable;
|
||||||
use crate::ship::drops::generic_shield::GenericShieldTable;
|
use crate::ship::drops::generic_shield::GenericShieldTable;
|
||||||
|
|
||||||
|
type ItemParseFn = Box<dyn Fn(&String) -> Option<RareDropItem>>;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub enum RareDropItem {
|
pub enum RareDropItem {
|
||||||
@ -29,7 +30,7 @@ pub enum RareDropItem {
|
|||||||
|
|
||||||
impl RareDropItem {
|
impl RareDropItem {
|
||||||
pub fn from_string(name: String) -> RareDropItem {
|
pub fn from_string(name: String) -> RareDropItem {
|
||||||
let parse_funcs: [Box<dyn Fn(&String) -> Option<RareDropItem>>; 6] = [
|
let parse_funcs: [ItemParseFn; 6] = [
|
||||||
Box::new(|i| Some(RareDropItem::Weapon(str::parse::<WeaponType>(i).ok()?))),
|
Box::new(|i| Some(RareDropItem::Weapon(str::parse::<WeaponType>(i).ok()?))),
|
||||||
Box::new(|i| Some(RareDropItem::Armor(str::parse::<ArmorType>(i).ok()?))),
|
Box::new(|i| Some(RareDropItem::Armor(str::parse::<ArmorType>(i).ok()?))),
|
||||||
Box::new(|i| Some(RareDropItem::Shield(str::parse::<ShieldType>(i).ok()?))),
|
Box::new(|i| Some(RareDropItem::Shield(str::parse::<ShieldType>(i).ok()?))),
|
||||||
|
@ -330,7 +330,7 @@ impl<'a> ItemStateProxy<'a> {
|
|||||||
self.item_state.character_bank.extend(self.proxied_state.character_bank.clone());
|
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_room.extend(self.proxied_state.character_room.clone());
|
||||||
self.item_state.character_floor.extend(self.proxied_state.character_floor.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ impl TradeState {
|
|||||||
return Err(TradeStateError::MismatchedTrade(c1.client, c2.client));
|
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?
|
// TODO: is it possible for this to not return Options?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user