Releases: TedDriggs/darling
Releases · TedDriggs/darling
v0.20.4
- Accept bare paths in
#[darling(default = ...)]#258 - Add
FromMetaimpl forPathBuf#259 - Improve
FromMetaimplementation for enums #260- Properly implement unit arms in
FromMeta::from_listto provide a consistent API for heterogeneous enums that include a mix of unit, newtype and struct variants - Add
#[darling(word)]attribute for unit enum variants (See #63 for details)
- Properly implement unit arms in
v0.20.3
- Add
FromMetaimpl foru128andi128#243
This release also includes features originally slated for 0.20.2, as that was never published.
v0.20.1
v0.20.0
v0.20.0 (April 27, 2023)
Breaking Changes
-
Replace all occurrences of syn::NestedMeta with darling::ast::NestedMeta.
-
Replacement for the deprecated AttributeArgs:
// Before
parse_macro_input!(args as AttributeArgs);
// After
match NestedMeta::parse_meta_list(args) {
Ok(v) => v,
Err(e) => {
return TokenStream::from(Error::from(e).write_errors());
}
};- In GenericParamExt,
LifetimeDefis nowLifetimeParam. - In GenericParamExt,
as_lifetime_defis renamed toas_lifetime_param. - Flag and SpannedValue no longer implement
syn::spanned::Spanned. - The MSRV (minimum supported Rust version) is now 1.56, because of syn.
Deprecation Warnings
In previous versions of darling, arbitrary expressions were passed in attributes by wrapping them in quotation marks.
v0.20.0 preserves this behavior for syn::Expr, but as a result a field expecting a syn::Expr cannot accept a string literal - it will incorrectly attempt to parse the contents. If this is an issue for you, please add a comment to #229.
v0.14.4
v0.14.3
- Re-export
synfromdarlingto avoid requiring that consuming crates have asyndependency. - Change
<SpannedValue<T> as FromMeta>impl to more precisely capture the value span, as opposed to the span of the entire item. - Add
darling::util::{AsShape, Shape, ShapeSet}to improve "shape" validation for structs and variants. #222
v0.14.2
v0.14.1
v0.14.0
- BREAKING CHANGE: Remove many trait impls from
util::Flag.
This type had a number of deref and operator impls that made it usable as sort-of-a-boolean.
Real-world usage showed this type is more useful if it's able to carry a span for good errors,
and that most of those impls were unnecessary. #179 - Remove need for
#[darling(default)]onOption<T>andFlagfields #161 - Improve validation of enum shapes #178
- Bump
proc-macro2dependency to 1.0.37 #180 - Bump
quotedependency to 1.0.18 #180 - Bump
syndependency to 1.0.91 #180