All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
substitute!
andsubstitute_item
allow the use of global substitutions without duplication. See #49.
- [BREAKING] Increased base MSRV to 1.65.
- [BREAKING]
duplicate!
andduplicate_item
no longer allow using exclusively global substitutions. - Edition increased to 2021.
- Replaced
proc-macro-error
dependency withproc-macro2-diagnostics
for printing nice error messages and hints. See #61. - Updated
heck
dependency to version 0.5.
- Overhauled the
pretty_errors
feature to more consistently provide useful hints and code highlights. See #19.
duplicate
now also substitutes the invocations of nestedduplicate
's. See #48.- Forgetting to enclose subtitution parameters in brackets now reports sensible error. See #30.
- Short syntax no longer accepts providing no substitution groups after the identifier list. See #29.
- Fixed several issues where code was accepted which shouldn't have been.
- Fixed an issue where
duplicate
's edition would leak into the user's code. See #47.
- Nested invocations can now be used everywhere.
- [BREAKING] Renamed
duplicate::duplicate
toduplicate::duplicate_item
. See #40. - [BREAKING] Renamed
duplicate::duplicate_inline
toduplicate::duplicate
. See #40. - [BREAKING] Nested invocation now uses
duplicate!{[<invocation>] <body>}
syntax instead of#[<invocation>][<body>]
. See #28. - [BREAKING] Increased base MSRV to 1.42. See #45
- [BREAKING] Relaxed MSRV policy. Only the minimal versions of direct and transitive dependencies are guaranteed to work for the MSRV. See #44
- No longer pinning dependencies following new MSRV policy.
- Updated
heck
dependency to version 0.4.
- Global Substitution: Allows substitutions that are applied to all duplicates equally. See #23.
- [BREAKING] Limited which group delimiters are allowed in various syntactic positions. The specific delimiters required now follow the use of delimiters in previous documentation examples. See #25.
- Substituted the
convert_case
dependency forheck
. See #22.
- Now also substitutes code inside substitution arguments. See #24.
- Module_disambiguation: Now only substitutes the module name and not any matching identifier in the body of the module. See #27.
- New Minimum Supported Rust Version (MSRV) Policy. Briefly, MSRV is 1.34 but may be increased by enabling features. See #18.
- The crate's readme now contains section on MSRV policy.
- Parameterized substitution is now also available for the verbose syntax. See #8.
duplicate_inline
: Function-like procedural macro version ofduplicate
. Has the same functionality, but can be used in other contexts and can duplicate any number of items. See also #6.
- Updated
proc_macro_error
dependency to version 1.0.4.
- New feature named
pretty_errors
(enabled by default). When enabled, errors are more detailed and helpful. - New feature named
module_disambiguation
(enabled by default). When enabled, automatically uses a suitable substitution identifier to disambiguate the name of a module being duplicated. See the documentation for more details. See also #7.
- Errors are now less detailed and helpful unless the
pretty_errors
feature is enabled. - The dependence on the
proc_macro_error
crate is now optional and used by thepretty_errors
feature.
- Fixed a build issue when using version 1.0.3 of
proc_macro_error
. See #11.
- The
proc_macro_error
dependency is fixed to version 1.0.3 to avoid potential breaking changes with future updates to that crate.
- Fixed issue with the short syntax where substitutions that included any bracket type would be expanded wrong. See #9.
- Short syntax now supports parameterized substitution. This allows identifiers to take arguments that can be used to customize the substitution for each use. See #5.
- Short syntax now supports nested macro invocations. Can only be used after the initial list of substitution identifiers. See #2.
- Updated documentation. The short syntax is now used for the primary examples.
- Crate readme license section no longer includes paragraph on the licensing of contibutions.
- Fixed an issue where
#[duplicate(..)]
would throw an error if it was generated by a macro expansion. It would fail if a substitution identifier originated from a macro variable. This is caused by the variable's expansion sometimes being wrapped in a group with no delimiters, whichduplicate
couldn't handle.
- Updated crate readme to new short syntax.
- Crate readme changelog section now asserts the use of Semantic Versioning and Keep a Changelog.
- New short syntax with row-based substitution groups instead of the old column-based syntax. See github issue.
- Crate readme format titles are now bigger than changelog entries.
- Crate readme now includes list of changes when published to
crates.io
.
duplicate
attribute macro for code duplication and substitution.- Short invocation syntax for
duplicate
. - Verbose invocation syntax for
duplicate
.