CI check for Clippy
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1d66e08d48
commit
ebc1565429
|
@ -11,4 +11,8 @@ steps:
|
||||||
- name: build-release-linux
|
- name: build-release-linux
|
||||||
image: deukhoofd/linux64builder
|
image: deukhoofd/linux64builder
|
||||||
commands:
|
commands:
|
||||||
- cargo build --release
|
- cargo build --release
|
||||||
|
- name: clippy-check
|
||||||
|
image: deukhoofd/linux64builder
|
||||||
|
commands:
|
||||||
|
- cargo clippy --all-targets -- -D warnings
|
|
@ -78,7 +78,7 @@ mod tests {
|
||||||
random.expect_get_between().returning_st(|low, high| {
|
random.expect_get_between().returning_st(|low, high| {
|
||||||
assert_eq!(1, low);
|
assert_eq!(1, low);
|
||||||
assert_eq!(6, high);
|
assert_eq!(6, high);
|
||||||
return 1;
|
1
|
||||||
});
|
});
|
||||||
Rc::new(random)
|
Rc::new(random)
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,7 @@ mod tests {
|
||||||
.returning(|stat, amount, self_inflicted| {
|
.returning(|stat, amount, self_inflicted| {
|
||||||
assert_eq!(Statistic::Attack, stat);
|
assert_eq!(Statistic::Attack, stat);
|
||||||
assert_eq!(2, amount);
|
assert_eq!(2, amount);
|
||||||
assert_eq!(false, self_inflicted);
|
assert!(!self_inflicted);
|
||||||
true
|
true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ mod tests {
|
||||||
target
|
target
|
||||||
.expect_battle()
|
.expect_battle()
|
||||||
.once()
|
.once()
|
||||||
.return_once_st(move || Some(battle.clone()));
|
.return_once_st(move || Some(battle));
|
||||||
let target = Rc::new(target);
|
let target = Rc::new(target);
|
||||||
|
|
||||||
let script = AfterYou::new();
|
let script = AfterYou::new();
|
||||||
|
|
|
@ -52,7 +52,7 @@ impl Script for Assist {
|
||||||
let party = battle.find_party_for_pokemon(&user).unwrap().party();
|
let party = battle.find_party_for_pokemon(&user).unwrap().party();
|
||||||
let possible_moves = Self::get_party_moves(&party, &user);
|
let possible_moves = Self::get_party_moves(&party, &user);
|
||||||
|
|
||||||
if possible_moves.len() == 0 {
|
if possible_moves.is_empty() {
|
||||||
choice.fail();
|
choice.fail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
#![feature(adt_const_params)]
|
#![feature(adt_const_params)]
|
||||||
#![cfg_attr(not(feature = "mock_data"), no_std)]
|
#![cfg_attr(not(feature = "mock_data"), no_std)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
|
// These give false positives too often
|
||||||
|
#![allow(clippy::borrowed_box)]
|
||||||
|
#![allow(clippy::needless_lifetimes)]
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
extern crate core;
|
extern crate core;
|
||||||
|
@ -24,6 +27,7 @@ static ALLOC: dlmalloc::GlobalDlmalloc = dlmalloc::GlobalDlmalloc {};
|
||||||
|
|
||||||
pub(crate) use crate::app_interface::StringKey;
|
pub(crate) use crate::app_interface::StringKey;
|
||||||
pub(crate) use crate::handling::extern_ref::*;
|
pub(crate) use crate::handling::extern_ref::*;
|
||||||
|
use alloc::boxed::Box;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
@ -31,8 +35,12 @@ pub mod app_interface;
|
||||||
pub mod handling;
|
pub mod handling;
|
||||||
pub mod utils;
|
pub mod utils;
|
||||||
|
|
||||||
|
pub type LoadScriptFnType = Box<dyn Fn(ScriptCategory, &StringKey) -> Option<Box<dyn Script>>>;
|
||||||
|
|
||||||
#[cfg(not(feature = "mock_data"))]
|
#[cfg(not(feature = "mock_data"))]
|
||||||
mod implementation {
|
mod implementation {
|
||||||
|
use super::LoadScriptFnType;
|
||||||
|
|
||||||
use crate::app_interface::list::{EffectParameterImmutableList, ImmutableListWasm};
|
use crate::app_interface::list::{EffectParameterImmutableList, ImmutableListWasm};
|
||||||
use crate::app_interface::{
|
use crate::app_interface::{
|
||||||
BattleImpl, DamageSource, DynamicLibraryImpl, EffectParameter, ExecutingMoveImpl, ItemImpl,
|
BattleImpl, DamageSource, DynamicLibraryImpl, EffectParameter, ExecutingMoveImpl, ItemImpl,
|
||||||
|
@ -48,8 +56,6 @@ mod implementation {
|
||||||
use cstr_core::{c_char, CString};
|
use cstr_core::{c_char, CString};
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
|
|
||||||
pub type LoadScriptFnType = Box<dyn Fn(ScriptCategory, &StringKey) -> Option<Box<dyn Script>>>;
|
|
||||||
|
|
||||||
static mut LOAD_SCRIPT_FN: Option<LoadScriptFnType> = None;
|
static mut LOAD_SCRIPT_FN: Option<LoadScriptFnType> = None;
|
||||||
|
|
||||||
pub fn set_load_script_fn(f: LoadScriptFnType) {
|
pub fn set_load_script_fn(f: LoadScriptFnType) {
|
||||||
|
@ -663,5 +669,9 @@ mod implementation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use crate::handling::{Script, ScriptCategory};
|
||||||
#[cfg(not(feature = "mock_data"))]
|
#[cfg(not(feature = "mock_data"))]
|
||||||
pub use implementation::*;
|
pub use implementation::*;
|
||||||
|
|
||||||
|
#[cfg(feature = "mock_data")]
|
||||||
|
pub fn set_load_script_fn(_f: LoadScriptFnType) {}
|
||||||
|
|
Loading…
Reference in New Issue