use std::fmt::{self, Display, Formatter};
#[allow(missing_docs)]
#[derive(Debug, PartialEq, Eq, Clone)]
#[non_exhaustive]
pub enum Platform {
Linux,
Bsd,
Windows,
MacOS,
Illumos,
Ios,
Android,
Nintendo,
Xbox,
PlayStation,
Fuchsia,
Redox,
Unknown(String),
}
impl Display for Platform {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
if let Self::Unknown(_) = self {
f.write_str("Unknown: ")?;
}
f.write_str(match self {
Self::Linux => "Linux",
Self::Bsd => "BSD",
Self::Windows => "Windows",
Self::MacOS => "Mac OS",
Self::Illumos => "illumos",
Self::Ios => "iOS",
Self::Android => "Android",
Self::Nintendo => "Nintendo",
Self::Xbox => "XBox",
Self::PlayStation => "PlayStation",
Self::Fuchsia => "Fuchsia",
Self::Redox => "Redox",
Self::Unknown(a) => a,
})
}
}