refactor(domain): move DB string conversions out of domain enums

This commit is contained in:
2026-05-15 01:54:32 +02:00
parent a123c0b8cc
commit 344bcf34af
11 changed files with 124 additions and 74 deletions

View File

@@ -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 {