Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
timidger
5y ago
0 comments
Share
Which you'd never write in practice since `expect` exists
0 comments
default
newest
oldest
vikiomega9
5y ago
Can you say more here, I don't have the context.
steveklabnik
5y ago
This code is identical to
let file = file.expect("file was null");
That is, the "expect" method does exactly this.
jeswin
5y ago
I like Rust from what I've tried. But I'd have preferred something like this:
let file = file.unwrapOrPanicWith("file was null");
option.expect(message) doesn't semantically make sense.
2 more replies
j
/
k
navigate · click thread line to collapse