diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-11-10 15:40:33 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-11-10 15:40:33 +0100 |
commit | ab62c59acb49d1f3563d546eb6af13bf40739c2f (patch) | |
tree | 1ff341bd63b069163e3bed6ea092a1d356afbead | |
parent | 8797eed0abdefac9a550b7ef55f60ba5899a17bf (diff) | |
download | garage-ab62c59acb49d1f3563d546eb6af13bf40739c2f.tar.gz garage-ab62c59acb49d1f3563d546eb6af13bf40739c2f.zip |
Fix indent again
-rw-r--r-- | src/web/web_server.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/web/web_server.rs b/src/web/web_server.rs index 2c6185a1..cda7f52e 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -71,23 +71,28 @@ async fn handler( fn authority_to_host(authority: &str) -> Result<&str, Error> { let mut iter = authority.chars().enumerate(); let split = match iter.next() { - Some((_, '[')) => { + Some((_, '[')) => { let mut niter = iter.skip_while(|(_, c)| c != &']'); - niter.next().ok_or(Error::BadRequest(format!("Authority {} has an illegal format", authority)))?; + niter.next().ok_or(Error::BadRequest(format!( + "Authority {} has an illegal format", + authority + )))?; niter.next() - }, + } Some((_, _)) => iter.skip_while(|(_, c)| c != &':').next(), None => return Err(Error::BadRequest(format!("Authority is empty"))), }; - match split { + match split { Some((i, ':')) => Ok(&authority[..i]), None => Ok(authority), - Some((_, _)) => Err(Error::BadRequest(format!("Authority {} has an illegal format", authority))), + Some((_, _)) => Err(Error::BadRequest(format!( + "Authority {} has an illegal format", + authority + ))), } } - fn host_to_bucket<'a>(host: &'a str, root: &str) -> &'a str { if root.len() >= host.len() || !host.ends_with(root) { return host; |