Update derive_more requirement from 1.0.0 to 2.0.1
Updates the requirements on derive_more to permit the latest version.
Release notes
Sourced from derive_more's releases.
v1.0.0 - Finally a stable release
derive_moreis a library that adds derives for many of the standard library traits. By using this library the following code just works:use derive_more::{Add, Display, From, Into}; #[derive(PartialEq, From, Add)] struct MyInt(i32); #[derive(PartialEq, From, Into)] struct Point2D { x: i32, y: i32, } #[derive(PartialEq, From, Add, Display)] enum MyEnum { #[display("int: {_0}")] Int(i32), Uint(u32), #[display("nothing")] Nothing, } assert!(MyInt(11) == MyInt(5) + 6.into()); assert!((5, 6) == Point2D { x: 5, y: 6 }.into()); assert!(MyEnum::Int(15) == (MyEnum::Int(8) + 7.into()).unwrap()); assert!(MyEnum::Int(15).to_string() == "int: 15"); assert!(MyEnum::Uint(42).to_string() == "42"); assert!(MyEnum::Nothing.to_string() == "nothing");Now, more than 8 years after the first commit and almost 5 years after the 0.99.0 release,
derive_morehas finally reached its 1.0.0 release. This release contains a lot of changes (including some breaking ones) to make it easier to use the derives and make it possible to extend them without having to break backwards compatibility again. There are five major changes that I would like to call out, but there are many more changes that are documented below:
- There is a new
Debugderive that can be used to easily customizeDebugformatting.- A greatly improved
Displayderive, which allows you to do anything thatthiserrorprovides, but it works for any type not just errors. And by combining theDisplayderive with theErrorandFromderives, there shouldn't really be any need to usethiserroranymore (if you are missing a feature/behaviour fromthiserrorplease report an issue).- Traits that can return errors now return a type that implements
Errorwhen an error occurs instead of a&'static str.- When using
use derive_more::SomeTraitthe actual trait is also imported not just the derive macro. This is especially useful forErrorandDisplay- The docs are now rendered on docs.rs and are much better overall.
Breaking changes
- The minimum supported Rust version (MSRV) is now Rust 1.75.
- Add the
stdfeature which should be disabled inno_stdenvironments.- All Cargo features, except
std, are now disabled by default. Thefullfeature can be used to get the old behavior of supporting all possible derives.- The
TryFrom,Add,Sub,BitAnd,BitOr,BitXor,NotandNegderives now return a dedicated error type instead of a&'static stron error.- The
FromStrderive now uses a dedicatedFromStrErrorerror type instead of generating unique one each time.- The
Displayderive (and otherfmt-like ones) now uses#[display("...", (<expr>),*)]syntax instead of#[display(fmt = "...", ("<expr>"),*)], and#[display(bound(<bound>))]instead of#[display(bound = "<bound>")]. So without the double quotes around the expressions and bounds.- The
DebugandDisplayderives (and otherfmt-like ones) now transparently delegate to the inner type when#[display("...", (<expr>),*)]attribute is trivially substitutable with a transparent call. (#322)
... (truncated)
Changelog
Sourced from derive_more's changelog.
1.0.0 - 2024-08-07
More than 8 years after the first commit and almost 5 years after the 0.99.0 release,
derive_morehas finally reached its 1.0.0 release. This release contains a lot of changes (including some breaking ones) to make it easier to use the derives and make it possible to extend them without having to break backwards compatibility again. There are five major changes that I would like to call out, but there are many more changes that are documented below:
- There is a new
Debugderive that can be used to easily customizeDebugformatting.- A greatly improved
Displayderive, which allows you to do anything thatthiserrorprovides, but it works for any type not just errors. And by combining theDisplayderive with theErrorandFromderives, there shouldn't really be any need to usethiserroranymore (if you are missing a feature/behaviour fromthiserrorplease report an issue).- Traits that can return errors now return a type that implements
Errorwhen an error occurs instead of a&'static str.- When using
use derive_more::SomeTraitthe actual trait is also imported not just the derive macro. This is especially useful forErrorandDisplay- The docs are now rendered on docs.rs and are much better overall.
Breaking changes
- The minimum supported Rust version (MSRV) is now Rust 1.75.
- Add the
stdfeature which should be disabled inno_stdenvironments.- All Cargo features, except
std, are now disabled by default. Thefullfeature can be used to get the old behavior of supporting all possible derives.- The
TryFrom,Add,Sub,BitAnd,BitOr,BitXor,NotandNegderives now return a dedicated error type instead of a&'static stron error.- The
FromStrderive now uses a dedicatedFromStrErrorerror type instead of generating unique one each time.- The
Displayderive (and otherfmt-like ones) now uses#[display("...", (<expr>),*)]syntax instead of#[display(fmt = "...", ("<expr>"),*)], and#[display(bound(<bound>))]instead of#[display(bound = "<bound>")]. So without the double quotes around the expressions and bounds.- The
DebugandDisplayderives (and otherfmt-like ones) now transparently delegate to the inner type when#[display("...", (<expr>),*)]attribute is trivially substitutable with a transparent call. (#322)- The
DebugCustomderive is renamed to justDebug(gated now under a separatedebugfeature), and its semantics were changed to be a superset ofstdvariant ofDebug.- The
Fromderive doesn't deriveFrom<()>for enum variants without any fields anymore. This feature was removed because it was considered useless in
... (truncated)
Commits
- See full diff in compare view
Dependabot commands
You can trigger Dependabot actions by commenting on this MR
-
$dependabot recreatewill recreate this MR rewriting all the manual changes and resolving conflicts