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

This commit is contained in:
2022-10-14 16:53:30 +02:00
parent 9efe1b4e22
commit 691bf7c12e
56 changed files with 354 additions and 249 deletions

View File

@@ -15,7 +15,8 @@ pub struct LookupGrowthRate {
}
impl LookupGrowthRate {
/// Instantiates a new lookup growth rate.
/// Instantiates a new lookup growth rate. The experience vec should be the amount of experience
/// required per level, with the first element being the experience required for level 1 (generally 0).
pub fn new(experience: Vec<u32>) -> LookupGrowthRate {
LookupGrowthRate { experience }
}

View File

@@ -51,7 +51,7 @@ pub mod tests {
pub fn build() -> AbilityLibrary {
let mut lib = AbilityLibrary::new(1);
lib.add(
&StringKey::new("test_ability".into()),
&StringKey::new("test_ability"),
Arc::new(Ability::new(&"test_ability".into(), &"test_ability".into(), Vec::new())),
);
// Drops borrow as mut

View File

@@ -71,7 +71,7 @@ pub mod tests {
let m = build_move();
// Borrow as mut so we can insert
let w = &mut lib;
w.add(&StringKey::new("foo".into()), Arc::new(m));
w.add(&StringKey::new("foo"), Arc::new(m));
// Drops borrow as mut
lib

View File

@@ -49,27 +49,27 @@ pub enum EffectParameter {
String(ValueIdentifier, StringKey),
}
impl Into<EffectParameter> for bool {
fn into(self) -> EffectParameter {
EffectParameter::Bool(Default::default(), self)
impl From<bool> for EffectParameter {
fn from(b: bool) -> Self {
EffectParameter::Bool(Default::default(), b)
}
}
impl Into<EffectParameter> for i64 {
fn into(self) -> EffectParameter {
EffectParameter::Int(Default::default(), self)
impl From<i64> for EffectParameter {
fn from(i: i64) -> Self {
EffectParameter::Int(Default::default(), i)
}
}
impl Into<EffectParameter> for f32 {
fn into(self) -> EffectParameter {
EffectParameter::Float(Default::default(), self)
impl From<f32> for EffectParameter {
fn from(f: f32) -> Self {
EffectParameter::Float(Default::default(), f)
}
}
impl Into<EffectParameter> for StringKey {
fn into(self) -> EffectParameter {
EffectParameter::String(Default::default(), self)
impl From<StringKey> for EffectParameter {
fn from(s: StringKey) -> Self {
EffectParameter::String(Default::default(), s)
}
}