From b31b7a7688a81a5fe80ec864a6114810a2bb480b Mon Sep 17 00:00:00 2001 From: Jeff Hajewski Date: Tue, 17 Oct 2017 04:28:58 -0500 Subject: [PATCH] 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. --- CONTRIBUTING.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 258a54c..c805e9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 minimum. -Follow the error handling templates in ["A note about error -handling"][errors]. Examples always set up error handling correctly and -propagate errors with `?` (not `try!`). +When an example must handle the possibility of errors, follow the error handling +templates in ["A note about error handling"][errors]. Examples always set up +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 traits they are calling. (Some crates might consider using glob