fix(deps): update rust crate derive_more to v1 #138
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
javascript
question
rust
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
renovate-bot
renovate-security
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mCaptcha/survey#138
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/derive_more-1.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
->1.0
Release Notes
JelteF/derive_more (derive_more)
v1.0.0
Compare Source
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 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:
Debug
derive that can be used to easily customizeDebug
formatting.
Display
derive, which allows you to do anything thatthiserror
provides, but it worksfor any type not just errors. And by combining the
Display
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).
Error
when an error occurs instead of a
&'static str
.use derive_more::SomeTrait
the actual trait is also importednot just the derive macro. This is especially useful for
Error
andDisplay
Breaking changes
std
feature which should be disabled inno_std
environments.std
, are now disabled by default. Thefull
feature can be used to get the old behavior of supporting all possible
derives.
TryFrom
,Add
,Sub
,BitAnd
,BitOr
,BitXor
,Not
andNeg
derives now return a dedicated error type instead of a
&'static str
onerror.
FromStr
derive now uses a dedicatedFromStrError
error type insteadof generating unique one each time.
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 quotesaround the expressions and bounds.
Debug
andDisplay
derives (and otherfmt
-like ones) now transparentlydelegate to the inner type when
#[display("...", (<expr>),*)]
attribute istrivially substitutable with a transparent call.
(#322)
DebugCustom
derive is renamed to justDebug
(gated now under a separatedebug
feature), and its semantics were changed to be a superset ofstd
variantof
Debug
.From
derive doesn't deriveFrom<()>
for enum variants without anyfields anymore. This feature was removed because it was considered useless in
practice.
From
derive now uses#[from(<types>)]
instead of#[from(types(<types>))]
and ignores field type itself.
Into
derive now uses#[into(<types>)]
instead of#[into(types(<types>))]
and ignores field type itself.
Into
derive now generates separate impls for each field whenever the#[into(...)]
attribute is applied to it. (#291)
Error
derive is updated with changes to theerror_generic_member_access
unstable feature for nightly users. (#200,
#294)
as_mut
feature is removed, and theAsMut
derive is now gated by theas_ref
feature. (#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
Display
derives. So now you can use:#[display(fmt = "Prefix: {field}")]
instead of needing to use#[display(fmt = "Prefix: {}", field)]
FromStr
derive support for enums that contain variants without fields.If you pass the name of the variant to
from_str
it will create the matchingvariant.
#[unwrap(owned, ref, ref_mut)]
attribute for theUnwrap
derive.By using them, it is possible to derive implementations for the reference types as well.
(#206)
TryUnwrap
derive similar to theUnwrap
derive. This one returns aResult
and does not panic.(#206)
Debug
derive with the same syntax asDisplay
derives.(#279)
derive_more::derive
module exporting only macros, without traits.(#290)
AsRef
/AsMut
derives.(#298)
TryFrom
derive for enums to convert from their discriminant.(#300)
#[inline]
attributes toIsVariant
andDebug
implementations.(#334
#[track_caller]
toAdd
,Mul
,AddAssign
andMulAssign
derives(#378
Changed
Constructor
andIsVariant
derives now generateconst fn
functions.IsVariant
are now marked#[must_use]
.(#350)
Unwrap
andIsVariant
derives 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.
syn
2.0.Error
derive now works in nightlyno_std
environmentsFixed
HashSet
in all derives, this is needed for rust analyzerto work correctly.
Provider
API for backtraces inError
derive.Error
derive not working withconst
generics.Box<dyn Error + Send + 'static>
IntoIterator
impls for generic structs.(#284)
Display
derive.(#297)
core
crate.(#327)
IsVariant
derive.{field:p}
do the expected thing in format strings forDisplay
andDebug
. Also document weirdness aroundPointer
formatting when usingexpressions, 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.
This PR has been generated by Renovate Bot.
527b027840
to5e13c7fbba
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: Cargo.lock
5e13c7fbba
toba53834902
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.