replace one Owned reference by the normal Reference type

This commit is contained in:
Christof Petig 2022-07-07 00:40:35 +02:00
parent cea2550dde
commit 3a7835c6d0

View File

@ -813,9 +813,9 @@ impl TradePricing {
result result
} }
fn get_materials_impl(&self, item: &ItemDefinitionIdOwned) -> Option<MaterialUse> { fn get_materials_impl(&self, item: &ItemDefinitionId) -> Option<MaterialUse> {
//let tmp = format!("{:?}", item); //let tmp = format!("{:?}", item);
let ret = self.price_lookup(item).cloned(); let ret = self.price_lookup(&item.to_owned()).cloned();
// match item { // match item {
// ItemDefinitionIdOwned::Simple(id) => self.price_lookup(id).cloned(), // ItemDefinitionIdOwned::Simple(id) => self.price_lookup(id).cloned(),
// ItemDefinitionIdOwned::Modular { components, .. } => Some( // ItemDefinitionIdOwned::Modular { components, .. } => Some(
@ -854,7 +854,7 @@ impl TradePricing {
#[must_use] #[must_use]
pub fn get_materials(item: &ItemDefinitionId) -> Option<MaterialUse> { pub fn get_materials(item: &ItemDefinitionId) -> Option<MaterialUse> {
TRADE_PRICING.get_materials_impl(&item.to_owned()) TRADE_PRICING.get_materials_impl(item)
} }
#[cfg(test)] #[cfg(test)]