Fix indent again
This commit is contained in:
parent
8797eed0ab
commit
ab62c59acb
1 changed files with 11 additions and 6 deletions
|
@ -73,9 +73,12 @@ fn authority_to_host(authority: &str) -> Result<&str, Error> {
|
|||
let split = match iter.next() {
|
||||
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"))),
|
||||
};
|
||||
|
@ -83,11 +86,13 @@ fn authority_to_host(authority: &str) -> Result<&str, Error> {
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue