1 pub enum Singleton { 2 Unit, 3 } 4 5 #[no_mangle] is_unit(s: Singleton) -> bool6 pub fn is_unit(s: Singleton) -> bool { 7 match s { 8 Singleton::Unit => true, 9 } 10 } 11