Clippy fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-02 11:25:36 +01:00
parent f2b0d3b9f3
commit aae41b93bb
11 changed files with 18 additions and 19 deletions

View File

@@ -151,7 +151,7 @@ mod tests {
fn get_user(level: LevelInt) -> Pokemon {
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
let species = lib.static_data().species().get(&"foo".into()).unwrap();
let form = species.get_form(&"default".into()).unwrap();
Pokemon::new(

View File

@@ -117,7 +117,7 @@ impl Battle {
number_of_hits,
choice.user().clone(),
used_move.clone(),
move_data.clone(),
move_data,
move_choice.script().clone(),
);
let mut prevented = false;

View File

@@ -141,8 +141,7 @@ impl Pokemon {
.static_data()
.natures()
.get_nature(nature)
.unwrap_or_else(|| panic!("Unknown nature name was given: {}.", &nature))
.clone();
.unwrap_or_else(|| panic!("Unknown nature name was given: {}.", &nature));
let mut pokemon = Self {
identifier: Default::default(),
library,
@@ -892,7 +891,7 @@ pub mod test {
#[test]
fn construct_pokemon() {
let lib = mock_library();
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
let species = lib.static_data().species().get(&"foo".into()).unwrap();
let form = species.get_form(&"default".into()).unwrap();
let pokemon = Pokemon::new(

View File

@@ -46,7 +46,7 @@ impl PokemonBuilder {
Random::default()
};
let species = self.library.static_data().species().get(&self.species).unwrap().clone();
let species = self.library.static_data().species().get(&self.species).unwrap();
let form = species.get_default_form();
let p = Pokemon::new(
self.library,

View File

@@ -36,7 +36,7 @@ impl ScriptSet {
/// Adds a script with a name to the set. If the script with that name already exists in this
/// set, this makes that script stack instead. The return value here is that script.
pub fn stack_or_add<'b, F>(&self, key: &StringKey, instantiation: &'b F) -> PkmnResult<Option<ScriptContainer>>
pub fn stack_or_add<F>(&self, key: &StringKey, instantiation: &F) -> PkmnResult<Option<ScriptContainer>>
where
F: Fn() -> PkmnResult<Option<Arc<dyn Script>>>,
{