Skip to content

Commit

Permalink
Simplify comments and remove redundant ..
Browse files Browse the repository at this point in the history
  • Loading branch information
yescallop committed Apr 11, 2024
1 parent 9854a59 commit d1772e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/normalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) fn normalize(u: Uri<&str>) -> Uri<String> {
#[cfg(feature = "net")]
HostMeta::Ipv6(addr) => write!(buf, "[{addr}]").unwrap(),
#[cfg(not(feature = "net"))]
HostMeta::Ipv6(..) => {
HostMeta::Ipv6() => {
buf.push('[');
write_v6(&mut buf, parser::parse_v6(&auth.host().as_bytes()[1..]));
buf.push(']');
Expand Down
15 changes: 1 addition & 14 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,8 @@ pub(crate) fn resolve(
if r_path.is_absolute() {
t_path = remove_dot_segments(&mut buf, r_path.as_str());
} else {
// Instead of merging the paths, remove dot segments incrementally.
let base_path = base.path().as_str();

// let merged_path = if base_path.is_empty() {
// alloc::format!("/{base_path}")
// } else {
// alloc::format!(
// "{}/{}",
// base_path.rsplit_once('/').unwrap().0,
// r_path.as_str()
// )
// };
// t_path = remove_dot_segments(&mut buf, &merged_path);

// Merging paths like above requires another allocation.

if base_path.is_empty() {
buf.push('/');
} else {
Expand Down

0 comments on commit d1772e7

Please sign in to comment.