fix: simplify normalize_segments

This commit is contained in:
lhzapata
2026-07-25 08:50:53 -03:00
parent 6c1cb774e9
commit 5bae43f1cc
+2 -3
View File
@@ -777,10 +777,9 @@ fn normalize_segments(path: &str) -> Option<String> {
format!("{}:/", path[..1].to_ascii_uppercase()),
path[3..].split('/').collect(),
)
} else if let Some(rest) = path.strip_prefix('/') {
("/".into(), rest.split('/').collect())
} else {
return None;
let rest = path.strip_prefix('/')?;
("/".into(), rest.split('/').collect())
};
let mut parts = Vec::new();
for part in tail {