reformat, add ping command
This commit is contained in:
+2
-8
@@ -22,10 +22,7 @@ pub(crate) fn acct_to_server(acct: &str) -> Option<&str> {
|
||||
acct.trim_start_matches('@').split('@').nth(1)
|
||||
}
|
||||
|
||||
pub(crate) fn normalize_acct<'a, 'g>(
|
||||
acct: &'a str,
|
||||
group: &'g str,
|
||||
) -> Result<Cow<'a, str>, GroupError> {
|
||||
pub(crate) fn normalize_acct<'a, 'g>(acct: &'a str, group: &'g str) -> Result<Cow<'a, str>, GroupError> {
|
||||
let acct = acct.trim_start_matches('@');
|
||||
if acct_to_server(acct).is_some() {
|
||||
// already has server
|
||||
@@ -82,9 +79,6 @@ mod test {
|
||||
Ok("piggo@piggo.space".into()),
|
||||
normalize_acct("piggo@piggo.space", "uhh")
|
||||
);
|
||||
assert_eq!(
|
||||
Err(GroupError::BadConfig("_".into())),
|
||||
normalize_acct("piggo", "uhh")
|
||||
);
|
||||
assert_eq!(Err(GroupError::BadConfig("_".into())), normalize_acct("piggo", "uhh"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user