We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8075df5 commit 62efcc6Copy full SHA for 62efcc6
src/cmd/test.rs
@@ -43,11 +43,12 @@ pub fn make_subcommand() -> Command {
43
44
// test command implementation
45
pub fn execute(args: &ArgMatches) -> Result<()> {
46
- let library_paths: Vec<&str> = args
47
- .get_many::<String>("library-path")
48
- .unwrap()
49
- .map(|s| s.as_str())
50
- .collect();
+ let library_paths: Vec<&str> = if let Some(it) = args.get_many::<String>("library-path") {
+ it.map(|s| s.as_str()).collect()
+ } else {
+ vec![]
+ };
51
+
52
let chapter: Option<&str> = args.get_one::<String>("chapter").map(|s| s.as_str());
53
54
let book_dir = get_book_dir(args);
0 commit comments