mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 07:27:46 +00:00
uucore/refactor ~ fix cargo clippy
complaints (or_fun_call)
This commit is contained in:
parent
e9a767a59c
commit
bc1084a9f5
1 changed files with 1 additions and 1 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue