xmpp-parsers: Run rustfmt
Sorry, I made a mistake and pushed directly to main. T_T
This commit is contained in:
parent
9b77b968a9
commit
3eb8a2ae11
1 changed files with 6 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue