diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 457b95b8..595d7d22 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,8 +18,6 @@ changes to this document in a pull request. * [Peer review](#peer-review) * [Repository maintainers](#repository-maintainers) - [Coding conventions](#coding-conventions) - * [Formatting](#formatting) - * [MSRV](#msrv) * [Naming conventions](#naming-conventions) * [Upgrading dependencies](#upgrading-dependencies) * [Unsafe code](#unsafe-code) @@ -380,6 +378,27 @@ sure, feel free to ask. If we determine panicking is more practical it must be d panics that could theoretically occur because of bugs in our code must not be documented. +#### Derives + +We try to use standard set of derives if it makes sense: + +``` +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +enum Foo { + Bar, + Baz, +} +``` + +For types that do should not form a total or partial order, or that technically do but it does not +make sense to compare them, we use the `Ordered` trait from the +[`ordered`](https://crates.io/crates/ordered) crate. See `absolute::LockTime` for an example. + +For error types you likely want to use `#[derive(Debug, Clone, PartialEq, Eq)]`. + +See [Errors](#errors) section. + + #### Attributes - `#[track_caller]`: Used on functions that panic on invalid arguments