1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-12 20:35:18 +02:00

rm: don't update target_exists every time in the loop ()

This commit is contained in:
nibon7
2022-10-21 22:42:29 +08:00
committed by GitHub
parent b2c29117d9
commit c6436eb32f

@ -231,10 +231,12 @@ fn rm(
) { ) {
Ok(files) => { Ok(files) => {
for file in files { for file in files {
target_exists = true;
match file { match file {
Ok(ref f) => { Ok(ref f) => {
if !target_exists {
target_exists = true;
}
// It is not appropriate to try and remove the // It is not appropriate to try and remove the
// current directory or its parent when using // current directory or its parent when using
// glob patterns. // glob patterns.