refactor(uri): Remove extra authority logic

Remove extra logic in authority getter method which handles
default ports.
This commit is contained in:
M3rs
2017-01-21 21:20:24 -06:00
parent 4f5327afd4
commit 55d13a9afd

View File

@@ -107,6 +107,7 @@ impl Uri {
pub fn authority(&self) -> Option<&str> {
if let Some(end) = self.authority_end {
let index = self.scheme_end.map(|i| i + 3).unwrap_or(0);
Some(&self.source[index..end])
} else {
None