Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Book uses Result::expect() but still makes reference to Option::expect() #31912

Closed
Sgeo opened this issue Feb 26, 2016 · 3 comments
Closed

Comments

@Sgeo
Copy link
Contributor

Sgeo commented Feb 26, 2016

https://doc.rust-lang.org/book/guessing-game.html contains statements like

If we leave off calling these two methods, our program will compile, but we’ll get a warning:

Luckily, if we just want to crash if there’s a problem, we can use these two little methods.

The book used to use .ok().expect(...), but has switched to .expect(...), from two methods for error handling/crashing to one.

@steveklabnik
Copy link
Member

This has been fixed in nightly: https://doc.rust-lang.org/nightly/book/guessing-game.html

If we leave off calling this method, our program will compile, but we’ll get a warning:

@Sgeo
Copy link
Contributor Author

Sgeo commented Feb 28, 2016

The first line looks fixed, but the second doesn't, "we can use these two little methods" is still present.

@steveklabnik steveklabnik reopened this Feb 28, 2016
@steveklabnik
Copy link
Member

I thought I accepted PRs for all of it, will double check. Thanks.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 9, 2016
When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes rust-lang#31912
steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 10, 2016
Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes rust-lang#31912
steveklabnik added a commit to steveklabnik/rust that referenced this issue Mar 10, 2016
Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes rust-lang#31912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants