Reduce again the number of match calls (#7815)

- Reduce the number of match calls (see commit messages)
- A few miscellaneous improvements
This commit is contained in:
Hofer-Julian
2023-01-24 12:23:42 +01:00
committed by GitHub
parent 0bb2e47c98
commit 41306aa7e0
49 changed files with 467 additions and 634 deletions

View File

@ -35,14 +35,16 @@ impl Example {
eprintln!("flag: {:}", flag);
eprintln!("rest: {:?}", rest);
match opt {
Some(v) => eprintln!("Found optional value opt: {:}", v),
None => eprintln!("No optional value found"),
if let Some(v) = opt {
eprintln!("Found optional value opt: {:}", v)
} else {
eprintln!("No optional value found")
}
match named {
Some(v) => eprintln!("Named value: {:?}", v),
None => eprintln!("No named value found"),
if let Some(v) = named {
eprintln!("Named value: {:?}", v)
} else {
eprintln!("No named value found")
}
Ok(())