Musing this morning...

The "let <refutable_pattern> = <expr> else { <divergence> };" syntax was added to Rust quite recently. In a version of Rust where this syntax was available from the get-go...

...could we have removed unwrap()/expect()?

Could this have also removed a need for #[track_caller]? (There might be others, but I think unwrap/expect were one of the big motivations.)

Because I feel like it's gradually replacing the remaining uses of unwrap in my own code (and there aren't a lot).

0

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