Skip to content

Commit 62efcc6

Browse files
committed
fix: get_many
1 parent 8075df5 commit 62efcc6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/cmd/test.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ pub fn make_subcommand() -> Command {
4343

4444
// test command implementation
4545
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();
46+
let library_paths: Vec<&str> = if let Some(it) = args.get_many::<String>("library-path") {
47+
it.map(|s| s.as_str()).collect()
48+
} else {
49+
vec![]
50+
};
51+
5152
let chapter: Option<&str> = args.get_one::<String>("chapter").map(|s| s.as_str());
5253

5354
let book_dir = get_book_dir(args);

0 commit comments

Comments
 (0)