|
4 | 4 | [](https://crates.io/crates/derive_more) |
5 | 5 | [](https://docs.rs/derive_more) |
6 | 6 | [](https://raw.githubusercontent.com/JelteF/derive_more/master/LICENSE) |
7 | | -[](https://blog.rust-lang.org/2023/08/24/Rust-1.72.0.html) |
| 7 | +[](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html) |
8 | 8 | [](https://github.com/rust-secure-code/safety-dance) |
9 | 9 |
|
10 | 10 | Rust has lots of builtin traits that are implemented for its basic types, such |
@@ -137,13 +137,22 @@ These don't derive traits, but derive static methods instead. |
137 | 137 | 4. [`TryUnwrap`], for each variant `foo` of an enum type, derives an `try_unwrap_foo` method. |
138 | 138 |
|
139 | 139 |
|
| 140 | +### Re-exports |
| 141 | + |
| 142 | +This crate also re-exports all the standard library traits that it adds derives |
| 143 | +for. So, both the `Display` derive and the `Display` trait will be in scope when |
| 144 | +you add the following code: |
| 145 | +```rust |
| 146 | +use derive_more::Display; |
| 147 | +``` |
| 148 | + |
| 149 | + |
140 | 150 |
|
141 | 151 |
|
142 | 152 | ## Installation |
143 | 153 |
|
144 | | -This library requires Rust 1.72 or higher. To avoid redundant compilation times, by |
145 | | -default no derives are supported. You have to enable each type of derive as a feature |
146 | | -in `Cargo.toml`: |
| 154 | +To avoid redundant compilation times, by default no derives are supported. |
| 155 | +You have to enable each type of derive as a feature in `Cargo.toml`: |
147 | 156 |
|
148 | 157 | ```toml |
149 | 158 | [dependencies] |
@@ -176,14 +185,25 @@ extern crate derive_more; |
176 | 185 | # fn main() {} // omit wrapping statements above into `main()` in tests |
177 | 186 | ``` |
178 | 187 |
|
179 | | -## Re-exports |
180 | 188 |
|
181 | | -This crate also re-exports all of the standard library traits that it adds |
182 | | -derives for. So both the `Display` derive and the `Display` trait will be in |
183 | | -scope when you add the following code: |
184 | | -```rust |
185 | | -use derive_more::Display; |
186 | | -``` |
| 189 | +## [MSRV] policy |
| 190 | + |
| 191 | +This library requires Rust 1.65 or higher. |
| 192 | + |
| 193 | +Changing [MSRV] (minimum supported Rust version) of this crate is treated as a **minor version change** in terms of [Semantic Versioning]. |
| 194 | +- So, if [MSRV] changes are **NOT concerning** for your project, just use the default [caret requirement]: |
| 195 | + ```toml |
| 196 | + [dependencies] |
| 197 | + derive_more = "1" # or "1.0", or "^1.0" |
| 198 | + ``` |
| 199 | +- However, if [MSRV] changes are concerning for your project, then use the [tilde requirement] to **omit breaking code**: |
| 200 | + ```toml |
| 201 | + [dependencies] |
| 202 | + derive_more = "~1.0" # or "~1.0.0" |
| 203 | + ``` |
| 204 | + |
| 205 | + |
| 206 | + |
187 | 207 |
|
188 | 208 | [`cargo-expand`]: https://github.com/dtolnay/cargo-expand |
189 | 209 | [`derive-new`]: https://github.com/nrc/derive-new |
@@ -216,3 +236,8 @@ use derive_more::Display; |
216 | 236 | [`IsVariant`]: https://jeltef.github.io/derive_more/derive_more/is_variant.html |
217 | 237 | [`Unwrap`]: https://jeltef.github.io/derive_more/derive_more/unwrap.html |
218 | 238 | [`TryUnwrap`]: https://jeltef.github.io/derive_more/derive_more/try_unwrap.html |
| 239 | + |
| 240 | +[caret requirement]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements |
| 241 | +[tilde requirement]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements |
| 242 | +[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field |
| 243 | +[Semantic Versioning]: http://semver.org |
0 commit comments