diff --git a/src/models/recipe.rs b/src/models/recipe.rs index 30a06b7..7c21582 100644 --- a/src/models/recipe.rs +++ b/src/models/recipe.rs @@ -9,6 +9,8 @@ use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIter use serde::{Deserialize, Serialize}; use serde_json::Value; +use crate::recipe_functions::common::MATERIAL_INTER_GUARD; + pub trait CommonRecipeTrait { fn insert_comment(&mut self, comment: String); @@ -1849,10 +1851,10 @@ impl MaterialSetting { let cc = country_code.unwrap().parse::().expect("not a number"); let mat_num = self.id.clone().as_i64().unwrap(); - let check_if_start_with_cc = mat_num.to_string().starts_with(&format!("{cc}")); + let check_if_start_with_cc = mat_num > MATERIAL_INTER_GUARD as i64; if check_if_start_with_cc { - mat_num - (cc * 10000) + mat_num - (cc * MATERIAL_INTER_GUARD as i64) } else { mat_num }