Skip to content

Switch error handling setup to quick_main! macro from error-chain #59

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

Closed
brson opened this issue May 9, 2017 · 5 comments
Closed

Switch error handling setup to quick_main! macro from error-chain #59

brson opened this issue May 9, 2017 · 5 comments
Labels

Comments

@brson
Copy link
Contributor

brson commented May 9, 2017

Right now the error handling pattern suggested by the cookbook's 'about' page, and used in at least some of the examples, looks similar to quick_main!. Seems like we should just use that.

Switch the existing examples to replace 'main' with 'quick_main!', and update the about page.

cc @dtolnay @Yamakaky

@Yamakaky
Copy link
Contributor

Yamakaky commented May 9, 2017

quick_main! was maid for that usecase ^^

@Yamakaky
Copy link
Contributor

Yamakaky commented May 9, 2017

quick_main! was maid for that usecase ^^

I can do that

Yamakaky added a commit to Yamakaky/rust-cookbook that referenced this issue May 9, 2017
@budziq
Copy link
Collaborator

budziq commented May 9, 2017

Using following form will hide part of doctest boilerplate from rendering but still allow for the code to compile and run under skeptic.

```
# fn main() {
#    run().unwrap();
# }
```

It might make the existing snippets more ergonomic without the need to pull error-chain as dependency (or even hide error-chain noise if required)

cc @brson

@dtolnay
Copy link
Member

dtolnay commented May 9, 2017

Given that we don't have playground links (see #32), there needs to be a way to copy and run these examples. I would prefer not to hide main so that you can copy into a main.rs and expect it to work.

Yamakaky added a commit to Yamakaky/rust-cookbook that referenced this issue May 9, 2017
@brson
Copy link
Contributor Author

brson commented May 11, 2017

Yes, I want to not hide code in the cookbook, have the examples say everything they are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants