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

@@ -25,22 +25,6 @@ pub enum FollowState {
Accepted,
Rejected,
}
impl FollowState {
pub fn from_db_str(s: &str) -> Self {
match s {
"pending" => Self::Pending,
"rejected" => Self::Rejected,
_ => Self::Accepted,
}
}
pub fn as_str(&self) -> &str {
match self {
Self::Pending => "pending",
Self::Accepted => "accepted",
Self::Rejected => "rejected",
}
}
}
#[derive(Debug, Clone)]
pub struct Follow {