refactor(domain): move DB string conversions out of domain enums
This commit is contained in:
@@ -8,24 +8,6 @@ pub enum Visibility {
|
||||
Unlisted,
|
||||
Direct,
|
||||
}
|
||||
impl Visibility {
|
||||
pub fn from_db_str(s: &str) -> Self {
|
||||
match s {
|
||||
"followers" => Self::Followers,
|
||||
"unlisted" => Self::Unlisted,
|
||||
"direct" => Self::Direct,
|
||||
_ => Self::Public,
|
||||
}
|
||||
}
|
||||
pub fn as_str(&self) -> &str {
|
||||
match self {
|
||||
Self::Public => "public",
|
||||
Self::Followers => "followers",
|
||||
Self::Unlisted => "unlisted",
|
||||
Self::Direct => "direct",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Thought {
|
||||
|
||||
Reference in New Issue
Block a user