Skip to content

Releases

Add Clone impls for NestedList and NestedDict

Choose a tag to compare

@Techcable Techcable released this 12 Oct 10:06
0ff2b5e

Now requires the syn/clone-impls feature (which is on by default).

Added

  • Add Clone impl to parse::Braced wrapper (llwxntnt)
  • Derive Clone impls for NestedList and NestedDict (nsysprpp)

Changed

  • Require syn/clone-impls feature, needed for Clone impls for NestedList (among others) (qozqwmmk)
    • This is turned on in the default syn features, so shouldn't add any compile time in the common case.

Add Braced parse wrapper

Choose a tag to compare

@Techcable Techcable released this 06 Oct 01:55
a170daf

Added

  • Add Braced wrapper, which parses an item surrounded by braces { } (mpnuopmt)

Fix span of missing argument errors in nested structs.

Choose a tag to compare

@Techcable Techcable released this 04 Oct 06:20
07c1ebf

With the assistance of Claude Code, this release includes many other fixes and cleanups.

Added

  • Implement Debug for NestedDict (kwsztwtm)
  • Implement Default for NestedDict, 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, 5i64 can no longer be parsed as a u8. Unsuffixed literals are unaffected.
    • This is technically a breaking change, but any code that relied on the prior behavior was buggy.

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 syn or proc-macro2 (vlkusror)
  • Fix parse_macro_arg_via_syn! when invoked by path or without syn in scope (ossnuvpr)
  • Point ExplicitOption parse errors at the unexpected identifier instead of the token after it (sxzzzyzv)
  • Allow fields named argument_list or missing_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#type now take the argument type instead of r#type; both spellings are accepted (zunuotso)
  • NestedDict reports every duplicate key, instead of stopping at the first one (xuuxssvv)
  • Correct the docs for ParsedKeywordArguments ordering: 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_bar and foo__bar (loplrtmk)
    • Avoid non_snake_case warnings in generated code for fields that aren't snake case.
  • Reject generic structs in the derive with a clear error, instead of failing with confusing errors in generated code (klptmunk)

Rename crate to macro-kwargs

Choose a tag to compare

@Techcable Techcable released this 04 Oct 06:10
v0.3.3
bdf6136

Changes

  • BIG: Rename crate from proc-macro-kwargs to macro-kwargs. (ltmmqrrp)
    • Crate with old name has been marked #[deprecated(...)] in v0.3.1 and will receive no further updates.
    • This crate's versions start off where proc-macro-kwargs ended.

NOTE: The crate has no v0.3.2 version, neither under the old crate name nor the new one.

I originally meant to publish change rmnzyzlo (commit 4b51166) as v0.3.2,
but I accidentally published it as v0.3.3 on crates.io and messed up the CHANGELOG.
Since crates.io releases are immutable, I stuck with v0.3.3 as the version number for the release.

Warn about impending rename to `macro-kwargs`.

Choose a tag to compare

@Techcable Techcable released this 03 Oct 09:53
a08ea14

Changes

  • WARNING: Impending rename from proc-macro-kwargs to macro-kwargs.

The crate has been marked deprecated in favor of its new name.
The crate under the old name will receive no further updates.

Update to syn v3

Choose a tag to compare

@Techcable Techcable released this 03 Oct 09:39
ed6914d

Changes

  • BREAKING: Update to syn v3 (nzzxxmyz)

Add a #[kwarg(with_syn)] attribute

Choose a tag to compare

@Techcable Techcable released this 03 Oct 09:39
55420e6

Added

  • Support a #[kwarg(with_syn)] shorthand to parse via syn::Parse instead of MacroArg (smwonvvz)
    • More concise than using the proc_macro_kwargs::parse::Syn wrapper type (which doesn't even support #[kwarg(with_wrapper)])
    • Also available through the #[kwarg(syn)] shorthand

Support stable rust

Choose a tag to compare

@Techcable Techcable released this 03 Oct 08:21
v0.2.0
af7b9c1

Removes use of #[feature(trait_alias)],
allowing program to compile on stable rust in addition to nightly.

Upgrade heck from 0.4 to 0.5.

Upgrade to syn v2

Choose a tag to compare

@Techcable Techcable released this 03 Oct 08:20
v0.2.0-alpha.1
5108beb

Requires minor version bump for semver compatibility.

This is an alpha version because it removes impl MacroArg for NestedMeta,
At the time, I didn't know what the syn v2 replacement for NestedMeta is.

Fix "useless question mark" warning in derived code

Choose a tag to compare

@Techcable Techcable released this 03 Oct 08:19
v0.1.5
65b0d77

Add #[automatically_derived] to the generated trait impls.

Implement From<T> for Syn<T>.
Cannot add From<Syn<T>> for T due to coherence rules.