diff options
author | Rory Dudley | 2024-02-17 19:51:17 -0700 |
---|---|---|
committer | Rory Dudley | 2024-02-17 19:51:17 -0700 |
commit | 7fbd8e662e8f66937d647ec1f687dd8f7946de49 (patch) | |
tree | 7b8d3f65b93c822e3d2928d064489aff9011383a | |
parent | 55ff53d3a8b4cb879a50918f4df491c6043de9dd (diff) | |
download | dwarvish-7fbd8e662e8f66937d647ec1f687dd8f7946de49.tar.gz |
Control flow in cd
Make the control flow in our cd implementation a bit easier to
read/follow.
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 4c7c49a..5f73a15 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,14 +64,14 @@ fn eval(paths: &[&str], prompt: &str) { Some(str) => str, None => env!("HOME"), }; + match std::env::set_current_dir(path) { - Ok(_) => {} + Ok(_) => continue, Err(_) => { println!("cd: Unable to change into {}", path); continue; } } - continue; } // Check if the command exists |