Skip to content

Commit

Permalink
chore: Fix Clippy issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jetuk committed Dec 9, 2024
1 parent fd9d08a commit d2635f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pywr-core/src/parameters/interpolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions pywr-core/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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<f64>) -> Result<f64, PywrError> {
self.simple
.get_value(*idx.deref())
Expand Down Expand Up @@ -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<f64>) -> Result<f64, PywrError> {
self.constant
.get_value(*idx.deref())
Expand Down

0 comments on commit d2635f1

Please sign in to comment.