Fixes a bunch of clippy warnings, adds clippy to CI
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -42,7 +42,7 @@ pub mod tests {
|
||||
use crate::static_data::StaticStatisticSet;
|
||||
use hashbrown::HashSet;
|
||||
|
||||
fn build_species<'a>() -> Species {
|
||||
fn build_species() -> Species {
|
||||
Species::new(
|
||||
0,
|
||||
&"foo".into(),
|
||||
@@ -65,7 +65,7 @@ pub mod tests {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn build<'a>() -> SpeciesLibrary {
|
||||
pub fn build() -> SpeciesLibrary {
|
||||
let mut lib = SpeciesLibrary::new(1);
|
||||
let species = build_species();
|
||||
// Borrow as mut so we can insert
|
||||
|
||||
@@ -76,7 +76,7 @@ impl StaticData {
|
||||
pub fn abilities(&self) -> &AbilityLibrary {
|
||||
&self.abilities
|
||||
}
|
||||
pub fn abilities_mut<'a>(&'a mut self) -> &'a mut AbilityLibrary {
|
||||
pub fn abilities_mut(&mut self) -> &mut AbilityLibrary {
|
||||
&mut self.abilities
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ pub mod test {
|
||||
};
|
||||
use crate::static_data::natures;
|
||||
|
||||
pub fn build<'a>() -> StaticData {
|
||||
pub fn build() -> StaticData {
|
||||
StaticData {
|
||||
settings: LibrarySettings::new(100),
|
||||
species: species_library::tests::build(),
|
||||
|
||||
@@ -5,7 +5,7 @@ use hashbrown::HashSet;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
|
||||
pub enum MoveCategory {
|
||||
@@ -14,7 +14,7 @@ pub enum MoveCategory {
|
||||
Status = 2,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub enum MoveTarget {
|
||||
Adjacent = 0,
|
||||
|
||||
@@ -68,7 +68,7 @@ impl NatureLibrary {
|
||||
for kv in &self.map {
|
||||
// As natures can't be copied, and should always be the same reference as the value
|
||||
// in the map, we just compare by reference.
|
||||
if (kv.1 as *const Nature) == (nature as *const Nature) {
|
||||
if std::ptr::eq(kv.1, nature) {
|
||||
return kv.0.clone();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::StringKey;
|
||||
use hashbrown::hash_map::Entry::{Occupied, Vacant};
|
||||
use hashbrown::HashMap;
|
||||
|
||||
#[derive(Default, PartialEq, Debug)]
|
||||
#[derive(Default, PartialEq, Eq, Debug)]
|
||||
pub struct LearnableMoves {
|
||||
learned_by_level: HashMap<LevelInt, Vec<StringKey>>,
|
||||
distinct_level_moves: Vec<StringKey>,
|
||||
@@ -23,7 +23,7 @@ impl LearnableMoves {
|
||||
self.learned_by_level.insert(level, vec![m.clone()]);
|
||||
}
|
||||
}
|
||||
if !self.distinct_level_moves.contains(&m) {
|
||||
if !self.distinct_level_moves.contains(m) {
|
||||
self.distinct_level_moves.push(m.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user