summaryrefslogtreecommitdiff
path: root/commands/src/rmdir.rs
diff options
context:
space:
mode:
Diffstat (limited to 'commands/src/rmdir.rs')
-rw-r--r--commands/src/rmdir.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/commands/src/rmdir.rs b/commands/src/rmdir.rs
index d9d20e2..3777755 100644
--- a/commands/src/rmdir.rs
+++ b/commands/src/rmdir.rs
@@ -2,7 +2,7 @@ use toolkit::Toolkit;
use toolkit::error::*;
use crate::parser::Command;
-pub fn run(mut tk: &mut Toolkit, command: Command) {
+pub fn run(tk: &mut Toolkit, command: Command) {
if command.names.len() == 1 {
let path = tk.resolve_path(&command.names[0]);
@@ -15,17 +15,17 @@ pub fn run(mut tk: &mut Toolkit, command: Command) {
tk.rmdir(&path);
}
} else {
- display_error(&mut tk, Error::E11);
+ display_error(tk, Error::E11);
}
} else {
- display_error(&mut tk, Error::E09);
+ display_error(tk, Error::E09);
}
} else {
- display_error(&mut tk, Error::E04);
+ display_error(tk, Error::E04);
}
- } else if command.names.len() == 0 {
- display_error(&mut tk, Error::E03);
+ } else if command.names.is_empty() {
+ display_error(tk, Error::E03);
} else if command.names.len() > 1 {
- display_error(&mut tk, Error::E08);
+ display_error(tk, Error::E08);
}
} \ No newline at end of file