diff --git a/src/utils.rs b/src/utils.rs index 2e89d8d..f007b37 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -34,7 +34,7 @@ pub fn path_to_lowercase(path: impl AsRef) -> PathBuf { pub fn resolve_case_insensitive( base: impl AsRef, rel: impl AsRef, -) -> io::Result { +) -> io::Result> { 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)) }