Releases: AndreiPashkin/compose-idents
Releases · AndreiPashkin/compose-idents
v0.3.0
v0.3.0 - 2025-09-04
Added
- Introduced new code-repetition capability, that allows to produce multiple variations of user-supplied Rust code
usingfor ... in ...syntax. - Introduced a type system, overloaded functions, new type casting functions - this would allow users to use much wider
range of values, up to entirely arbitrary sequences of tokens. Previously values were limited only to idents. - Introduced an alternative attribute-style invocation form
#[compose_items(...)]. - Introduced new
compose!macro as the preferred entry point (functionally identical to the previous
compose_idents!). - MSRV has been set to
1.80.0. - Added syntax reference to the documentation.
- Added migration guides for deprecated features.
- Made it possible to escape percent signs when formatting strings by using
%%syntax. - Added
normalize2(...), an evaluated variant ofnormalize(...)that acceptsident,str,int,path,type,
expr, ortokensand returns a normalizedident(unlikenormalize(...), which consumes raw tokens).
Changed
- Error messages made to be more precise and informative.
- Made string formatting syntax more human-readable by enabling
% alias %-style placeholders (with whitespace). - Reworked introductory examples in the documentation.
- Significantly expanded project's test suite.
- Harden the testing of support for both MSRV and stable Rust versions and of usage of the library as a dependency.
Deprecated
compose_idents!macro has been deprecated in favor of functionally identicalcompose!.
Removed
-
⚠️ BREAKING: Dropped the deprecated bracket-based alias-definition syntax support. -
⚠️ BREAKING: Removed interchangeable use of literal strings and ident arguments in functions that accept both.Type system and overloaded functions should take care of most use-cases and if necessary - use casting functions:
to_ident(),to_str(), etc.
v0.2.2
v0.2.1
v0.2.0
v0.2.0 - 2025-06-11
Added
- It is now possible to define aliases directly from expressions without surrounding brackets,
for example:alias = exproralias = concat(arg1, arg2, ...). The old syntax will continue to work, but will
emit a deprecation warning. - New
concat()function that concatenates multiple arguments together. - Deprecation warning mechanism has been added. Now if a user uses something that is deprecated, the macro
will try to attach#[deprecated(...)]attribute to the generated code if it's possible.
Changed
- Refactored the reference - split a single big usage example into commented thematic Markdown sections.
- Added a minimal example into the beginning of the documentation.
- Stripped redundant top-level heading in docs.rs so that level-3 headings ("Functions", "Alias reuse", etc.) are now
visible in the sidebar. - Significantly reworked the internal code making it more extensible. Made a lot of smaller fixes and refactorings.
⚠️ BREAKING: case-conversion functions -snake_case(),camel_case(),pascal_case()have been re-implemented
using the excellentheckcrate. It will bring more correctness but also might introduce some small changes in
how these functions work.
Deprecated
- Deprecated
alias = [arg1, arg2, ...]syntax in favor of expression-based:alias = concat(arg1, arg2, ...)or
alias = upper(arg)oralias = arg, etc.
Fixed
- Fixed a bug in
normalize()function that could append an extra trailing underscore to the result. - Fixed a bug where certain inputs (like
Result<T, E>) could be erroneously rejected bynormalize().
v0.1.1
v0.1.1 - 2025-05-22
Added
Changed
- Make argument parsing more robust. In particular make
compose_idents!not fail with arguments such as
normalize(Foo::Bar), whereFoo::Baris an enum variant or anything else that could be ambiguously interpreted
if not parsed until the end of the token (for exampleFoo::Barcould be interpreted as an identFooand::Bar
as a next completely different token).
Removed
v0.1.0
v0.1.0 - 2025-05-19
Added
- Explicitly restricted defining duplicate aliases.
- Made it possible to re-use previously defined aliases as parts of definitions of subsequent aliases.
- Introduce the
normalize()function, which transforms arbitrary token sequences into valid identifiers.
Makes it possible to use things like&'static strin identifiers.
Changed
- Made it possible to pass arbitrary token sequences as arguments.