fix(deps): update rust crate derive_more to v2 #26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/derive_more-2.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.99.17->2.0.0Release Notes
JelteF/derive_more (derive_more)
v2.0.1Compare Source
Added
Playground will have all
derive_morefeatures available onceselectorscrate updates itsderive_moreversion.(#445)
v2.0.0Compare Source
Breaking changes
use derive_more::SomeTraitnow imports macro only. Importing macro withits trait along is possible now via
use derive_more::with_trait::SomeTrait.(#406)
#[display("...")]attribute on an enum now has defaulting behaviorinstead of replacing when no wrapping is possible (no
_variantplaceholder).(#395)
Fixed
Debugand
Displayexpansions.(#399)
unreachable_codewarnings on generated code when!(never type) is used.(#404)
TryFrom,TryIntoorFromStrwith an associated item called
ErrororErrrespectively.(#410)
#[display("...")]attribute on an enum being incorrectly treatedas transparent or wrapping.
(#395)
DebugandDisplayexpansions.(#431)
Debugexpansions.(#431)
#[display("...")]attribute on an enum not working transparentlyfor directly specified fields.
(#438)
DebugandDisplayexpansions.(#440)
v1.0.0Compare Source
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 releasecontains 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:
Debugderive that can be used to easily customizeDebugformatting.
Displayderive, which allows you to do anything thatthiserrorprovides, but it worksfor any type not just errors. And by combining the
Displayderive with theErrorandFromderives, there shouldn't really be any need to usethiserroranymore (if you are missing a feature/behaviour fromthiserrorplease report an issue).
Errorwhen an error occurs instead of a
&'static str.use derive_more::SomeTraitthe actual trait is also importednot just the derive macro. This is especially useful for
ErrorandDisplayBreaking changes
stdfeature which should be disabled inno_stdenvironments.std, are now disabled by default. Thefullfeature can be used to get the old behavior of supporting all possible
derives.
TryFrom,Add,Sub,BitAnd,BitOr,BitXor,NotandNegderives now return a dedicated error type instead of a
&'static stronerror.
FromStrderive now uses a dedicatedFromStrErrorerror type insteadof generating unique one each time.
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 quotesaround the expressions and bounds.
DebugandDisplayderives (and otherfmt-like ones) now transparentlydelegate to the inner type when
#[display("...", (<expr>),*)]attribute istrivially substitutable with a transparent call.
(#322)
DebugCustomderive is renamed to justDebug(gated now under a separatedebugfeature), and its semantics were changed to be a superset ofstdvariantof
Debug.Fromderive doesn't deriveFrom<()>for enum variants without anyfields anymore. This feature was removed because it was considered useless in
practice.
Fromderive now uses#[from(<types>)]instead of#[from(types(<types>))]and ignores field type itself.
Intoderive now uses#[into(<types>)]instead of#[into(types(<types>))]and ignores field type itself.
Intoderive now generates separate impls for each field whenever the#[into(...)]attribute is applied to it. (#291)
Errorderive is updated with changes to theerror_generic_member_accessunstable feature for nightly users. (#200,
#294)
as_mutfeature is removed, and theAsMutderive is now gated by theas_reffeature. (#295)#[display("...")]attribute on an enum now requires the usageof
{_variant}to include the variant instead of including it at{}. Thereason is that
{}now references the first argument to the format string,just like in all other format strings. (#377)
Added
Displayderives. So now you can use:#[display(fmt = "Prefix: {field}")]instead of needing to use#[display(fmt = "Prefix: {}", field)]FromStrderive support for enums that contain variants without fields.If you pass the name of the variant to
from_strit will create the matchingvariant.
#[unwrap(owned, ref, ref_mut)]attribute for theUnwrapderive.By using them, it is possible to derive implementations for the reference types as well.
(#206)
TryUnwrapderive similar to theUnwrapderive. This one returns aResultand does not panic.(#206)
Debugderive with the same syntax asDisplayderives.(#279)
derive_more::derivemodule exporting only macros, without traits.(#290)
AsRef/AsMutderives.(#298)
TryFromderive for enums to convert from their discriminant.(#300)
#[inline]attributes toIsVariantandDebugimplementations.(#334
#[track_caller]toAdd,Mul,AddAssignandMulAssignderives(#378
Changed
ConstructorandIsVariantderives now generateconst fnfunctions.IsVariantare now marked#[must_use].(#350)
UnwrapandIsVariantderives now generate doc comments.#[automatically_derived]is now emitted from all macro expansions. Thisshould prevent code style linters from attempting to modify the generated
code.
syn2.0.Errorderive now works in nightlyno_stdenvironmentsFixed
HashSetin all derives, this is needed for rust analyzerto work correctly.
ProviderAPI for backtraces inErrorderive.Errorderive not working withconstgenerics.Box<dyn Error + Send + 'static>IntoIteratorimpls for generic structs.(#284)
Displayderive.(#297)
corecrate.(#327)
IsVariantderive.{field:p}do the expected thing in format strings forDisplayandDebug. Also document weirdness aroundPointerformatting when usingexpressions, due to field variables being references.
(#381)
v0.99.20Compare Source
v0.99.19Compare Source
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.
This PR has been generated by Renovate Bot.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.