resolve_case_instenstive returns a result<option> now

This commit is contained in:
2026-03-03 16:01:30 +01:00
parent 50f16cd7a0
commit d84db4b0c1

View File

@@ -34,7 +34,7 @@ pub fn path_to_lowercase(path: impl AsRef<Path>) -> PathBuf {
pub fn resolve_case_insensitive(
base: impl AsRef<Path>,
rel: impl AsRef<Path>,
) -> io::Result<PathBuf> {
) -> io::Result<Option<PathBuf>> {
let mut current = base.as_ref().to_path_buf();
for part in rel.as_ref().iter() {
@@ -56,13 +56,10 @@ pub fn resolve_case_insensitive(
match found {
Some(path) => current = path,
None => {
return Err(io::Error::new(
io::ErrorKind::NotFound,
format!("Path component not found: {}", target),
));
return Ok(None);
}
}
}
Ok(current)
Ok(Some(current))
}