1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-05 15:37:47 +00:00

uucore/refactor ~ fix cargo clippy complaints (or_fun_call)

This commit is contained in:
Roy Ivy III 2020-11-07 19:58:23 -06:00
parent e9a767a59c
commit bc1084a9f5

View file

@ -39,7 +39,7 @@ pub fn resolve_relative_path(path: &Path) -> Cow<Path> {
return path.into();
}
let root = Component::RootDir.as_os_str();
let mut result = env::current_dir().unwrap_or(PathBuf::from(root));
let mut result = env::current_dir().unwrap_or_else(|_| PathBuf::from(root));
for comp in path.components() {
match comp {
Component::ParentDir => {