Skip to content

Commit 2e3760a

Browse files
committed
Using possible_values instead of validator for format arg
1 parent 219190b commit 2e3760a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/onefetch/cli.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,7 @@ impl Cli {
236236
.help("Select a output format.")
237237
.takes_value(true)
238238
.default_value("human")
239-
.validator(
240-
|t| {
241-
let opts = vec!["human", "json"];
242-
if opts.contains(&t.as_str()) {return Ok(()); }
243-
Err(String::from(format!("Output type must be one of the following: {:?}", opts)))
244-
}
245-
)
239+
.possible_values(&["human", "json"])
246240
)
247241
.get_matches();
248242

0 commit comments

Comments
 (0)