Repository navigation
Fix span of missing argument errors in nested structs.
With the assistance of Claude Code, this release includes many other fixes and cleanups.
Added
- Implement
DebugforNestedDict(kwsztwtm) - Implement
DefaultforNestedDict, allowing use with#[kwarg(optional)](xlmlvnwn)
Changed
- Declare minimum supported rust version of 1.71 (mrvqwsux)
- This is the oldest version that syn v3 supports.
- Relicense from MIT to
MIT OR Apache-2.0(kxrrqpts)- Since the MIT license is still an option, this change actually makes licensing more permissive.
- Require the exact matching version of
macro-kwargs-derive(ultltztn)- Generated code relies on internal APIs, so mismatched versions could fail to compile.
- Reject integer and float literals whose suffix doesn't match the target type (sovtoywz)
- For example,
5i64can no longer be parsed as au8. Unsuffixed literals are unaffected. - This is technically a breaking change, but any code that relied on the prior behavior was buggy.
- For example,
Fixed
- Fix span of missing argument errors in nested structs (pnrqmzup)
- Avoid redundant_field_names lint in generated code (nvqqkunl)
- Fix
#[kwarg(with_func = "...")], which previously failed to compile as the function wasn't properly called (movmzuok) - Generated code no longer requires a direct dependency on
synorproc-macro2(vlkusror) - Fix
parse_macro_arg_via_syn!when invoked by path or withoutsynin scope (ossnuvpr) - Point
ExplicitOptionparse errors at the unexpected identifier instead of the token after it (sxzzzyzv) - Allow fields named
argument_listormissing_argument_errors, which clashed with locals in generated code (vrtqvqnq) - Reject fields with duplicate argument names (via
rename), which previously made one of them impossible to set (owonzqoy) - Fields with raw names like
r#typenow take the argumenttypeinstead ofr#type; both spellings are accepted (zunuotso) NestedDictreports every duplicate key, instead of stopping at the first one (xuuxssvv)- Correct the docs for
ParsedKeywordArgumentsordering: arguments are in the order the user wrote them, not the order the fields are declared in (rwmympok)- This was already the actual behavior; only the documentation was wrong.
- Allow a trailing comma in
#[kwarg(...)], like#[kwarg(optional,)](xwwsquxv) - Fix derive failing on fields whose names differ only in case or underscores, like
foo_barandfoo__bar(loplrtmk)- Avoid
non_snake_casewarnings in generated code for fields that aren't snake case.
- Avoid
- Reject generic structs in the derive with a clear error, instead of failing with confusing errors in generated code (klptmunk)