PSA: Please don't do this in :

if let (Ok(foo), Ok(bar)) = (expensive_op(), expensive_op()) {
println!("{foo} {bar}")
}

It can be very inefficient, causing people to wait on your software wasting their time (I've just seen this in a fairly popular open source project with 3k stars)!

For a better, more maintainable and efficient version, see second toot or have a look at the playground for the full examples:

play.rust-lang.org/?version=st

1/2

0

If you have a fediverse account, you can quote this note from your own instance. Search https://floss.social/users/janriemer/statuses/115718200702471658 on your instance and quote it. (Note that quoting is not supported in Mastodon.)