lemmy/server/src/models.rs
2019-02-27 22:02:55 -08:00

20 lines
341 B
Rust

enum CommunityUserType {
CREATOR = 0,
MODERATOR = 1,
USER = 2
}
impl CommunityUserType {
fn from_u32(value: u32) -> CommunityUserType {
match value {
0 => CommunityUserType::CREATOR,
1 => CommunityUserType::MODERATOR,
2 => CommunityUserType::USER,
_ => panic!("Unknown value: {}", value),
}
}
}