uv-cli: use PathBuf::from

Conversions from strings to paths are always infallible.
This commit is contained in:
Andrew Gallant 2024-08-21 11:17:49 -04:00 committed by Andrew Gallant
parent 9348564580
commit d6a14464ab

View file

@ -731,10 +731,7 @@ fn parse_file_path(input: &str) -> Result<PathBuf, String> {
url.to_file_path()
.map_err(|()| "invalid file URL".to_string())
} else {
match PathBuf::from_str(input) {
Ok(path) => Ok(path),
Err(err) => Err(err.to_string()),
}
Ok(PathBuf::from(input))
}
}