Skip to content

Commit

Permalink
Describe MSRV policy in README
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Dec 4, 2023
1 parent 44a1516 commit 55019b7
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Latest Version](https://img.shields.io/crates/v/derive_more.svg)](https://crates.io/crates/derive_more)
[![Rust Documentation](https://docs.rs/derive_more/badge.svg)](https://docs.rs/derive_more)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/JelteF/derive_more/master/LICENSE)
[![Rust 1.65+](https://img.shields.io/badge/rustc-1.65+-lightgray.svg)](https://blog.rust-lang.org/2023/08/24/Rust-1.65.0.html)
[![Rust 1.65+](https://img.shields.io/badge/rustc-1.65+-lightgray.svg)](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance)

Rust has lots of builtin traits that are implemented for its basic types, such
Expand Down Expand Up @@ -151,9 +151,8 @@ use derive_more::Display;

## Installation

This library requires Rust 1.65 or higher. To avoid redundant compilation times, by
default no derives are supported. You have to enable each type of derive as a feature
in `Cargo.toml`:
To avoid redundant compilation times, by default no derives are supported.
You have to enable each type of derive as a feature in `Cargo.toml`:

```toml
[dependencies]
Expand Down Expand Up @@ -187,6 +186,23 @@ extern crate derive_more;
```


## [MSRV] policy

This library requires Rust 1.65 or higher.

Changing [MSRV] (minimum supported Rust version) of this crate is treated as a **minor version change** in terms of [Semantic Versioning].
- So, if [MSRV] changes are **NOT concerning** for your project, just use the default [caret requirement]:
```toml
[dependencies]
derive_more = "1" # or "1.0", or "^1.0"
```
- However, if [MSRV] changes are concerning for your project, then use the [tilde requirement] to **omit breaking code**:
```toml
[dependencies]
derive_more = "~1.0" # or "~1.0.0"
```




[`cargo-expand`]: https://github.com/dtolnay/cargo-expand
Expand Down Expand Up @@ -220,3 +236,8 @@ extern crate derive_more;
[`IsVariant`]: https://jeltef.github.io/derive_more/derive_more/is_variant.html
[`Unwrap`]: https://jeltef.github.io/derive_more/derive_more/unwrap.html
[`TryUnwrap`]: https://jeltef.github.io/derive_more/derive_more/try_unwrap.html

[caret requirement]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements
[tilde requirement]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements
[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
[Semantic Versioning]: http://semver.org

0 comments on commit 55019b7

Please sign in to comment.