-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Adapted @BurntSushi's blog post to new error handling guide. #28301
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
Adapted @BurntSushi's blog post to new error handling guide. #28301
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Beat me to it! Part of what was taking me so long was fixing the doc tests. It looks like a lot of yours will fail if you run |
Oh. |
Hmm. Yeah. 41 fail. That's strange. |
@ChristopherDumas It's because of the way I setup the code. The code is itself defined in the article, but it is extracted and stitched together to generate full Rust programs, which collectively form a Cargo package. This alleviated me from having a bunch of |
@ChristopherDumas And you'll probably have to |
Okay, so this is relevant, but this is why I said it shouldn't take too much editing: https://users.rust-lang.org/t/the-rust-programming-language-is-going-to-be-published-by-no-starch-press/2777 TL;DR: we're gonna get the book published, so I will have a Real Editor reading over it at some point, so we can take care of any problems then. 🎊 |
Ok. But I'll still be looking at it to see if theres an easier way to get the tests to run. |
chapter will explore those stumbling blocks and demonstrate how to use the | ||
standard library to make error handling concise and ergonomic. | ||
|
||
## Table of Contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question is: do we leave this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording may not be appropriate, but I am a fan of delivering a key message somewhere early on: Rust does error handling with return values, not exceptions. However... When I wrote the blog post, I assumed some familiarity with Rust and at least one other programming language, so that message is useful is establishing context. I'm not exactly sure how to calibrate that to TRPL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more thinking that this chapter having its own TOC is unusual; it is helpful here, but also, more sub-headings in rustbook might be a good thing as well. I dunno :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I do think that that message should be delivered early too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I misunderstood. I very much defer to your judgment on the ToC. :-)
Not in code blocks, but in the prose.
(and no worries about missing things, that's exactly why we review! I do it
all the time)
|
OK, I've added curly quotes. |
Okay! I think this is good to go. We just need
r=me afterwards! |
@steveklabnik What does |
@ChristopherDumas For squashing, I think you want to rebase your branch against master. Usually what I do is (with your branch checked out and |
@BurntSushi I tried to do this, but it couldn't apply one of the commits, (the one with the merge conflict). Any advice? |
…e the case study.
OK, I squashed all of the commits! |
@BurntSushi @steveklabnik Were ready to merge this! |
🎊 |
@BurntSushi is this command correct? |
@ChristopherDumas Incidentally, I am not well versed in the language of bors. Best to wait for @steveklabnik to come and get it squared away. :-) |
Is there a manual for bors? It seems like having one would be a good idea. |
I think my command was correct, but because I'm not a collaborator or an owner, bors ignored me. |
@ChristopherDumas Well, only people with access can wield the power of bors. |
Can you try my command? You have access... |
@bors r=steveklabnik |
📌 Commit e181226 has been approved by |
@bors: r+
|
📌 Commit e181226 has been approved by |
Yup! Bors only listens to people who have permissions. It's useful because if another committer came along, they could authorize it on my behalf.
|
@steveklabnik is there a manual for bors yet? |
…r=steveklabnik This was @steveklabnik's idea. Thanks @BurntSushi for the awesome blog post! r? @steveklabnik
🎉 Nice work @ChristopherDumas! :D |
Thanks! And thank you for the help, and the great blog post! |
This was @steveklabnik's idea. Thanks @BurntSushi for the awesome blog post!
r? @steveklabnik