3 ms·
You can do something like that ``` let x = Some(1); let x = match x { Some(x) => x, None => return, }; assert_eq!(x, 1); ```
by conradludgate 6y ago
You can do something like that
```
let x = Some(1);
let x = match x {
Some(x) => x,
None => return,
};
assert_eq!(x, 1);
```
- Zababa 6y agoHN doesn't uses Markdown syntax for formatting: "Text after a blank line that is indented by two or more spaces is reproduced verbatim. (This is intended for code.)" https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc