refactor(uri): Remove extra authority logic
Remove extra logic in authority getter method which handles default ports.
This commit is contained in:
@@ -107,6 +107,7 @@ impl Uri {
|
|||||||
pub fn authority(&self) -> Option<&str> {
|
pub fn authority(&self) -> Option<&str> {
|
||||||
if let Some(end) = self.authority_end {
|
if let Some(end) = self.authority_end {
|
||||||
let index = self.scheme_end.map(|i| i + 3).unwrap_or(0);
|
let index = self.scheme_end.map(|i| i + 3).unwrap_or(0);
|
||||||
|
|
||||||
Some(&self.source[index..end])
|
Some(&self.source[index..end])
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
Reference in New Issue
Block a user