use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize, Hash, PartialEq, Eq)]
#[serde(from = "i64", into = "i64")]
pub enum Platform {
Undeclared,
Apple,
NonApple,
NotSupported(i64),
}
impl From<i64> for Platform {
fn from(value: i64) -> Self {
match value {
0 => Platform::Undeclared,
1 => Platform::Apple,
2 => Platform::NonApple,
other => Platform::NotSupported(other),
}
}
}
impl From<Platform> for i64 {
fn from(value: Platform) -> Self {
match value {
Platform::Undeclared => 0,
Platform::Apple => 1,
Platform::NonApple => 2,
Platform::NotSupported(other) => other,
}
}
}