os_version/android.rs
1use anyhow::Result;
2use std::fmt;
3
4#[derive(Debug, Clone, PartialEq)]
5pub struct Android {}
6
7impl Android {
8 #[cfg(target_os = "android")]
9 pub fn detect() -> Result<Android> {
10 Ok(Android {})
11 }
12
13 #[cfg(not(target_os = "android"))]
14 pub fn detect() -> Result<Android> {
15 unreachable!()
16 }
17}
18
19impl fmt::Display for Android {
20 fn fmt(&self, w: &mut fmt::Formatter<'_>) -> fmt::Result {
21 write!(w, "android")
22 }
23}