ed_journals/modules/mixed/models/
mixed_material_category.rsuse serde::{Deserialize, Serialize};
use crate::modules::materials::MaterialCategory;
use crate::modules::mixed::models::mixed_material::MixedMaterial;
use crate::modules::odyssey::ItemCategory;
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(untagged)]
pub enum MixedMaterialCategory {
ShipMaterial(MaterialCategory),
OdysseyMaterial(ItemCategory),
}
impl From<MixedMaterial> for MixedMaterialCategory {
fn from(value: MixedMaterial) -> Self {
match value {
MixedMaterial::ShipMaterial(material) => {
MixedMaterialCategory::ShipMaterial(material.into())
}
MixedMaterial::OdysseyMaterial(item) => {
MixedMaterialCategory::OdysseyMaterial(item.into())
}
}
}
}