v0.2, refactor, improve some messages, fix lints

This commit is contained in:
2021-08-26 22:11:20 +02:00
parent 8afc77dd60
commit 52cf8f8e97
8 changed files with 1146 additions and 941 deletions
+13
View File
@@ -1,6 +1,8 @@
use std::borrow::Cow;
use std::error::Error;
use elefren::status_builder::Visibility;
use crate::error::GroupError;
pub trait LogError {
@@ -82,3 +84,14 @@ mod test {
assert_eq!(Err(GroupError::BadConfig("_".into())), normalize_acct("piggo", "uhh"));
}
}
pub trait VisExt: Copy {
/// Check if is private or direct
fn is_private(self) -> bool;
}
impl VisExt for Visibility {
fn is_private(self) -> bool {
self == Visibility::Direct || self == Visibility::Private
}
}