Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
CraftSpider committed Jan 24, 2021
1 parent 351b2ac commit c37c421
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tools/jsondocck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,17 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
}
}

let args = cap.name("args")
.map_or(Some(vec![]), |m| shlex::split(m.as_str()));
let args = cap.name("args").map_or(Some(vec![]), |m| shlex::split(m.as_str()));

let args = match args {
Some(args) => args,
None => {
print_err(
&format!("Invalid arguments to shlex::split: `{}`", cap.name("args").unwrap().as_str()),
lineno
&format!(
"Invalid arguments to shlex::split: `{}`",
cap.name("args").unwrap().as_str()
),
lineno,
);
errors = true;
continue;
Expand Down

0 comments on commit c37c421

Please sign in to comment.