diff options
author | Pierre Peltier <pierre.peltier@adevinta.com> | 2019-12-05 11:04:06 +0100 |
---|---|---|
committer | Abin Simon <abinsimon10@gmail.com> | 2019-12-06 11:35:03 +0530 |
commit | f344f42bfe67e432ce8838e3bf8d63b21d10122b (patch) | |
tree | 89ed381aa7226b3156c76e9a6ff96a6d07205013 | |
parent | 80ab697fb9287adfde799c5dd95c2109dce13a58 (diff) |
Fix the tests and avoid a regression
-rw-r--r-- | src/flags.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flags.rs b/src/flags.rs index 0a10b7f..848b158 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -74,7 +74,8 @@ impl Flags { }; let recursive = matches.is_present("recursive"); - let recursion_depth = match matches.value_of("depth") { + let recursion_input = matches.values_of("depth").and_then(|values| values.last()); + let recursion_depth = match recursion_input { Some(str) if recursive || layout == Layout::Tree => match str.parse::<usize>() { Ok(val) => val, Err(_) => { |