From d2635f1aea6049d27295662c896b8487f5a7129f Mon Sep 17 00:00:00 2001 From: James Tomlinson Date: Mon, 9 Dec 2024 13:17:25 +0000 Subject: [PATCH] chore: Fix Clippy issues. --- pywr-core/src/parameters/interpolate.rs | 4 ++-- pywr-core/src/state.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pywr-core/src/parameters/interpolate.rs b/pywr-core/src/parameters/interpolate.rs index 54073c57..79273672 100644 --- a/pywr-core/src/parameters/interpolate.rs +++ b/pywr-core/src/parameters/interpolate.rs @@ -58,14 +58,14 @@ pub fn linear_interpolation( } } - return if error_on_bounds { + if error_on_bounds { Err(InterpolationError::AboveUpperBounds) } else { Ok(points .last() .expect("This should be impossible because fp has been checked for a length of at least 2") .1) - }; + } } #[cfg(test)] diff --git a/pywr-core/src/state.rs b/pywr-core/src/state.rs index 88a076c7..2f99dea4 100644 --- a/pywr-core/src/state.rs +++ b/pywr-core/src/state.rs @@ -416,7 +416,7 @@ pub struct ParameterValuesRef<'a> { multi_values: &'a [MultiValue], } -impl<'a> ParameterValuesRef<'a> { +impl ParameterValuesRef<'_> { fn get_value(&self, idx: usize) -> Option<&f64> { self.values.get(idx) } @@ -435,7 +435,7 @@ pub struct SimpleParameterValues<'a> { simple: ParameterValuesRef<'a>, } -impl<'a> SimpleParameterValues<'a> { +impl SimpleParameterValues<'_> { pub fn get_simple_parameter_f64(&self, idx: SimpleParameterIndex) -> Result { self.simple .get_value(*idx.deref()) @@ -470,7 +470,7 @@ pub struct ConstParameterValues<'a> { constant: ParameterValuesRef<'a>, } -impl<'a> ConstParameterValues<'a> { +impl ConstParameterValues<'_> { pub fn get_const_parameter_f64(&self, idx: ConstParameterIndex) -> Result { self.constant .get_value(*idx.deref())