this (and other x_from_item) should be impl From<WeaponDetail> for WeaponShopItem. then the code here be w.into().price() / 8 (which might not work due to type inference not inferring enough but should still use standard From trait)
this (and other `x_from_item`) should be `impl From<WeaponDetail> for WeaponShopItem`. then the code here be `w.into().price() / 8` (which might not work due to type inference not inferring enough but should still use standard `From` trait)
nice warez u got there
return Some(10u32)
}
// other item factors?
Some((WeaponShopItem::weapon_from_item(w).price() / 8) as u32)
this (and other
x_from_item
) should beimpl From<WeaponDetail> for WeaponShopItem
. then the code here bew.into().price() / 8
(which might not work due to type inference not inferring enough but should still use standardFrom
trait)sold_item_handle.consume(amount)?;
},
// TODO: put a real error here
Ordering::Greater => {println!("i can't believe you've done this.");},
ItemMangerError::InvalidSale
}
}
pub fn get_sell_price(&self) -> Result<u32, ItemManagerError> {
this made more sense returning an
Option
I thinkReviewers