xmpp-parsers: Run rustfmt

Sorry, I made a mistake and pushed directly to main. T_T
This commit is contained in:
Link Mauve 2025-11-22 22:47:20 +01:00
commit 3eb8a2ae11

View file

@ -26,11 +26,15 @@ impl FromStr for ContentId {
type Err = Error; type Err = Error;
fn from_str(s: &str) -> Result<Self, Error> { fn from_str(s: &str) -> Result<Self, Error> {
let (lhs, rhs) = s.split_once('@').ok_or(Error::Other("Missing @ in cid URI."))?; let (lhs, rhs) = s
.split_once('@')
.ok_or(Error::Other("Missing @ in cid URI."))?;
if rhs != "bob.xmpp.org" { if rhs != "bob.xmpp.org" {
return Err(Error::Other("Wrong domain for cid URI.")); return Err(Error::Other("Wrong domain for cid URI."));
} }
let (algo, hex) = lhs.split_once('+').ok_or(Error::Other("Missing + in cid URI."))?; let (algo, hex) = lhs
.split_once('+')
.ok_or(Error::Other("Missing + in cid URI."))?;
let algo = match algo { let algo = match algo {
"sha1" => Algo::Sha_1, "sha1" => Algo::Sha_1,
"sha256" => Algo::Sha_256, "sha256" => Algo::Sha_256,