atm0s-media-server
atm0s-media-server copied to clipboard
chore(deps): update rust crate derive_more to v1
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| derive_more | workspace.dependencies | major | 0.99 -> 1.0 |
Release Notes
JelteF/derive_more (derive_more)
v1.0.0
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
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 practice. - The
Fromderive now uses#[from(<types>)]instead of#[from(types(<types>))]and ignores field type itself. - The
Intoderive now uses#[into(<types>)]instead of#[into(types(<types>))]and ignores field type itself. - The
Intoderive now generates separate impls for each field whenever the#[into(...)]attribute is applied to it. (#291) - Importing a derive macro now also imports its corresponding trait.
- The
Errorderive is updated with changes to theerror_generic_member_accessunstable feature for nightly users. (#200, #294) - The
as_mutfeature is removed, and theAsMutderive is now gated by theas_reffeature. (#295) - A top level
#[display("...")]attribute on an enum now requires the usage of{_variant}to include the variant instead of including it at{}. The reason is that{}now references the first argument to the format string, just like in all other format strings. (#377)
Added
- Add support captured identifiers in
Displayderives. So now you can use:#[display(fmt = "Prefix: {field}")]instead of needing to use#[display(fmt = "Prefix: {}", field)] - Add
FromStrderive support for enums that contain variants without fields. If you pass the name of the variant tofrom_strit will create the matching variant. - Add
#[unwrap(owned, ref, ref_mut)]attribute for theUnwrapderive. By using them, it is possible to derive implementations for the reference types as well. (#206) - Add
TryUnwrapderive similar to theUnwrapderive. This one returns aResultand does not panic. (#206) - Add support for container format in
Debugderive with the same syntax asDisplayderives. (#279) derive_more::derivemodule exporting only macros, without traits. (#290)- Add support for specifying concrete types to
AsRef/AsMutderives. (#298) - Add
TryFromderive for enums to convert from their discriminant. (#300) #[inline]attributes toIsVariantandDebugimplementations. (#334- Add
#[track_caller]toAdd,Mul,AddAssignandMulAssignderives (#378
Changed
- The
ConstructorandIsVariantderives now generateconst fnfunctions. - Static methods derived by
IsVariantare now marked#[must_use]. (#350) - The
UnwrapandIsVariantderives now generate doc comments. #[automatically_derived]is now emitted from all macro expansions. This should prevent code style linters from attempting to modify the generated code.- Upgrade to
syn2.0. - The
Errorderive now works in nightlyno_stdenvironments
Fixed
- Use a deterministic
HashSetin all derives, this is needed for rust analyzer to work correctly. - Use
ProviderAPI for backtraces inErrorderive. - Fix
Errorderive not working withconstgenerics. - Support trait objects for source in Error, e.g.
Box<dyn Error + Send + 'static> - Fix bounds on derived
IntoIteratorimpls for generic structs. (#284) - Fix documentation of generated bounds in
Displayderive. (#297) - Hygiene of macro expansions in presence of custom
corecrate. (#327) - Fix documentation of generated methods in
IsVariantderive. - Make
{field:p}do the expected thing in format strings forDisplayandDebug. Also document weirdness aroundPointerformatting when using expressions, due to field variables being references. (#381)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.