Merge rust-bitcoin/rust-bitcoin#2519: policy: Mention format of error variants
98d6ab3865
policy: Mention format of error variants (Tobin C. Harding) Pull request description: An error enum type should not use an `Error` prefix for its variants, mention as such in the policy docs. ACKs for top commit: apoelstra: ACK98d6ab3865
Tree-SHA512: 16375ff031af24e7b1a5e8206c9660512b26da86df4168ac4a18e48f118c455460d0fee78e1e1ce972a32daba9aff7fcc9d0043bfd21bae223f95d9e944330ca
This commit is contained in:
commit
eb28c16d87
|
@ -319,8 +319,9 @@ More specifically an error should
|
|||
- have private fields unless we are very confident they won't change.
|
||||
- derive `Debug, Clone, PartialEq, Eq` (and `Copy` iff not `non_exhaustive`).
|
||||
- implement Display using `write_err!()` macro if a variant contains an inner error source.
|
||||
- have `Error` suffix
|
||||
- call `internals::impl_from_infallible!
|
||||
- have `Error` suffix on error types (structs and enums).
|
||||
- not have `Error` suffix on enum variants.
|
||||
- call `internals::impl_from_infallible!`.
|
||||
- implement `std::error::Error` if they are public (feature gated on "std").
|
||||
|
||||
```rust
|
||||
|
|
Loading…
Reference in New Issue