-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
rust-lang/rust
#97891Milestone
Description
- I have checked the latest
main
branch to see if this has already been fixed - I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem:
let f = File::open("hello.txt").expect("Failed to open hello.txt"); |
Description of the problem:
let f = File::open("hello.txt").expect("Failed to open hello.txt");
"expect failed to open hello.txt" confused me. Are we expecting a failure?
Suggested fix:
let f = File::open("hello.txt").expect("Succeed to open hello.txt");
Or explain this API design more.
Same confused from stackoverflow: https://stackoverflow.com/questions/66362625/why-is-rusts-expect-called-expect
Metadata
Metadata
Assignees
Labels
No labels