refactor(domain): move DB string conversions out of domain enums
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user