diff --git a/packages/backend-rs/src/federation/acct.rs b/packages/backend-rs/src/federation/acct.rs index e332c31e32..ffc972ba84 100644 --- a/packages/backend-rs/src/federation/acct.rs +++ b/packages/backend-rs/src/federation/acct.rs @@ -7,10 +7,13 @@ pub struct Acct { pub host: Option, } -impl FromStr for Acct { - type Err = (); +#[derive(thiserror::Error, Debug)] +#[error("failed to convert string '{0}' into acct")] +pub struct InvalidAcctString(String); + +impl FromStr for Acct { + type Err = InvalidAcctString; - /// This never throw errors. Feel free to `.unwrap()` the result. fn from_str(value: &str) -> Result { let split: Vec<&str> = if let Some(stripped) = value.strip_prefix('@') { stripped