Skip to content

Commit

Permalink
refactor deco validate gas mixes method to associated function
Browse files Browse the repository at this point in the history
  • Loading branch information
KG32 committed Sep 23, 2024
1 parent b7fba0c commit 2914274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/deco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Deco {

pub fn calc<T: DecoModel + Clone + Sim>(&mut self, deco_model: T, gas_mixes: Vec<Gas>) -> Result<DecoRuntime, DecoCalculationError> {
// validate gas mixes
self.validate_gas_mixes(&deco_model, &gas_mixes)?;
Self::validate_gas_mixes(&deco_model, &gas_mixes)?;

// run model simulation until no deco stages
let mut sim_model: T = deco_model.clone();
Expand Down Expand Up @@ -333,7 +333,7 @@ impl Deco {
DEFAULT_CEILING_WINDOW * (ceiling / DEFAULT_CEILING_WINDOW).ceil()
}

fn validate_gas_mixes<T: DecoModel>(&self, deco_model: &T, gas_mixes: &[Gas]) -> Result<(), DecoCalculationError> {
fn validate_gas_mixes<T: DecoModel>(deco_model: &T, gas_mixes: &[Gas]) -> Result<(), DecoCalculationError> {
if gas_mixes.is_empty() {
return Err(DecoCalculationError::EmptyGasList);
}
Expand Down

0 comments on commit 2914274

Please sign in to comment.