mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
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:
@ -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(())
|
||||
|
Reference in New Issue
Block a user