1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #5117 from shinhs0506/is-empty

use is_empty()
This commit is contained in:
Daniel Hofstetter 2023-07-29 07:31:02 +02:00 committed by GitHub
commit a34eb43085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -400,7 +400,7 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> UR
} }
match rename(sourcepath, &targetpath, b, multi_progress.as_ref()) { match rename(sourcepath, &targetpath, b, multi_progress.as_ref()) {
Err(e) if e.to_string() == "" => set_exit_code(1), Err(e) if e.to_string().is_empty() => set_exit_code(1),
Err(e) => { Err(e) => {
let e = e.map_err_context(|| { let e = e.map_err_context(|| {
format!( format!(

View file

@ -100,7 +100,7 @@ fn remove(mut path: &Path, opts: Opts) -> Result<(), Error<'_>> {
if opts.parents { if opts.parents {
while let Some(new) = path.parent() { while let Some(new) = path.parent() {
path = new; path = new;
if path.as_os_str() == "" { if path.as_os_str().is_empty() {
break; break;
} }
remove_single(path, opts)?; remove_single(path, opts)?;