Skip to content

Commit

Permalink
Merge #82
Browse files Browse the repository at this point in the history
82: Display helpful message when there’s no results r=antifuchs a=Jayman2000

Closes #80.

Co-authored-by: Jason Yundt <[email protected]>
  • Loading branch information
bors[bot] and Jayman2000 authored Jun 16, 2022
2 parents 89a2a40 + 00cb3cb commit bc7002d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions chars/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ use chars::display;
use chars::human_names;

fn main() {
let args = env::args()
.skip(1)
.flat_map(|argument| human_names::from_arg(argument.as_ref()));
for c in args {
display::describe(c);
let args = env::args().skip(1);
for argument in args {
let results = human_names::from_arg(argument.as_ref());
if results.is_empty() {
eprintln!("No results for “{}”.", argument);
} else {
for c in results {
display::describe(c);
}
}
}
}

0 comments on commit bc7002d

Please sign in to comment.