Skip to content
Snippets Groups Projects
Commit c2e4e8cf authored by stratact's avatar stratact
Browse files

Use shadowing and cleanup

parent a955378d
No related branches found
No related tags found
1 merge request!53Code cleanup
......@@ -274,7 +274,7 @@ impl Command {
Command {
name: "history",
help: "Display all commands previously executed",
main: box |args: &[String], shell: &mut Shell| {
main: box |_: &[String], shell: &mut Shell| {
for command in shell.history.clone() {
println!("{}", command);
}
......@@ -335,12 +335,12 @@ fn main() {
shell.print_prompt();
if let Some(command_original) = readln() {
let command = command_original.trim();
if let Some(command) = readln() {
let command = command.trim();
if command == "exit" {
break;
} else if !command.is_empty() {
shell.on_command(&command, &commands);
shell.on_command(command, &commands);
}
} else {
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment