Style and Clippy fixes.
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:
@@ -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 }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user