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_more
is 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_more
has 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
Debug
derive that can be used to easily customizeDebug
formatting.- A greatly improved
Display
derive, which allows you to do anything thatthiserror
provides, but it works for any type not just errors. And by combining theDisplay
derive with theError
andFrom
derives, there shouldn't really be any need to usethiserror
anymore (if you are missing a feature/behaviour fromthiserror
please report an issue).- Traits that can return errors now return a type that implements
Error
when an error occurs instead of a&'static str
.- When using
use derive_more::SomeTrait
the actual trait is also imported not just the derive macro. This is especially useful forError
andDisplay
- 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
std
feature which should be disabled inno_std
environments.- All Cargo features, except
std
, are now disabled by default. Thefull
feature can be used to get the old behavior of supporting all possible derives.- The
TryFrom
,Add
,Sub
,BitAnd
,BitOr
,BitXor
,Not
andNeg
derives now return a dedicated error type instead of a&'static str
on error.- The
FromStr
derive now uses a dedicatedFromStrError
error type instead of generating unique one each time.- The
Display
derive (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
Debug
andDisplay
derives (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_more
has 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
Debug
derive that can be used to easily customizeDebug
formatting.- A greatly improved
Display
derive, which allows you to do anything thatthiserror
provides, but it works for any type not just errors. And by combining theDisplay
derive with theError
andFrom
derives, there shouldn't really be any need to usethiserror
anymore (if you are missing a feature/behaviour fromthiserror
please report an issue).- Traits that can return errors now return a type that implements
Error
when an error occurs instead of a&'static str
.- When using
use derive_more::SomeTrait
the actual trait is also imported not just the derive macro. This is especially useful forError
andDisplay
- 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
std
feature which should be disabled inno_std
environments.- All Cargo features, except
std
, are now disabled by default. Thefull
feature can be used to get the old behavior of supporting all possible derives.- The
TryFrom
,Add
,Sub
,BitAnd
,BitOr
,BitXor
,Not
andNeg
derives now return a dedicated error type instead of a&'static str
on error.- The
FromStr
derive now uses a dedicatedFromStrError
error type instead of generating unique one each time.- The
Display
derive (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
Debug
andDisplay
derives (and otherfmt
-like ones) now transparently delegate to the inner type when#[display("...", (<expr>),*)]
attribute is trivially substitutable with a transparent call. (#322)- The
DebugCustom
derive is renamed to justDebug
(gated now under a separatedebug
feature), and its semantics were changed to be a superset ofstd
variant ofDebug
.- The
From
derive 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 recreate
will recreate this MR rewriting all the manual changes and resolving conflicts