Skip to content

Commit 491060e

Browse files
committed
docs(contributing): de-duplicate the unwrap-comment phrasing
1 parent ab80b40 commit 491060e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ where
206206
- `Display`: derive when the type needs to be displayed, such as when it is printed to stderr or used in format strings.
207207
- `Error`: derive when the type is used as a `std::error::Error`, such as the error type in `Result` or the source of another error. Not all types with `Display` need `Error`.
208208
- A type that only needs formatting and not error handling should derive `Display` without `Error`.
209-
- Minimize `unwrap()` in non-test code; use proper error propagation. `unwrap()` is acceptable in tests, and is also acceptable for provably infallible operations when accompanied by a comment explaining why. When deliberately ignoring an error, use `.ok()` with a comment explaining why.
209+
- Minimize `unwrap()` in non-test code; use proper error propagation. `unwrap()` is acceptable in tests, and is also acceptable for provably infallible operations when accompanied by a comment explaining the invariant. When deliberately ignoring an error, use `.ok()` and document the rationale.
210210

211211
```rust
212212
#[derive(Debug, Display, Error)]

0 commit comments

Comments
 (0)