From f344f42bfe67e432ce8838e3bf8d63b21d10122b Mon Sep 17 00:00:00 2001 From: Pierre Peltier Date: Thu, 5 Dec 2019 11:04:06 +0100 Subject: [PATCH] Fix the tests and avoid a regression --- src/flags.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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::() { Ok(val) => val, Err(_) => {