Updates the wording on error handling to improve clarity.

It was not previously clear when a contributor should use `error_chain`
and when they should use `main()`. This patch adds a couple sentences to
the section on error handling to make that more explicit.
This commit is contained in:
Jeff Hajewski 2017-10-17 04:28:58 -05:00 committed by Michał Budzyński
parent 02ed855b21
commit b31b7a7688

View file

@ -147,9 +147,10 @@ The example should have minimal code that doesn't directly support the
description of the example. Keep extra functions and types to a description of the example. Keep extra functions and types to a
minimum. minimum.
Follow the error handling templates in ["A note about error When an example must handle the possibility of errors, follow the error handling
handling"][errors]. Examples always set up error handling correctly and templates in ["A note about error handling"][errors]. Examples always set up
propagate errors with `?` (not `try!`). error handling correctly and propagate errors with `?` (not `try!`). If there
is no need for error handling in the example, using `main()` is appropriate.
Don't use glob imports, even for preludes, so that users can see what Don't use glob imports, even for preludes, so that users can see what
traits they are calling. (Some crates might consider using glob traits they are calling. (Some crates might consider using glob