Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gardaani
on May 19, 2022
|
parent
|
context
|
favorite
| on:
Rust: A Critical Retrospective
Early exit code would be easier to write if Rust supported guard let.
veber-alex
on May 19, 2022
|
next
[–]
its coming soon, already available on nightly.
let Some(x) = foo() else { return 42 };
inferiorhuman
on May 20, 2022
|
parent
|
next
[–]
I'd suggest that something like that is already achievable by having foo return an Option and combining it with unwrap_or.
klodolph
on May 19, 2022
|
prev
[–]
Like this?
if let Ok(x) = my_func() { // ... }
Or do you mean something else?
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: