duplicate
duplicate copied to clipboard
Easy code duplicate with substitution for Rust
### Situation: Using `duplicate_item`, it is possible to substitute things in a nested (or lower) `duplicate_item`'s invocation: ```rust #[duplicate::duplicate_item( vals [val; [41]; [42];]; )] #[duplicate::duplicate_item( vals )] impl SomeType for...
### Short Description: Release a version 1.0.0 ### Motivation: Releasing a stable version of the crate signals to users that the crate is generally usable and can be depended upon....
### Situation: Following global substitutions with a substitutions variable list for short syntax, but not following that with any substitution groups, will successfully compile. Even though current behavior is workable,...
### Situation: When trying to use parametric substitution but forgetting to encapsulate the argument to a parametrized identifier in `[]`, the resulting error message is confusing. ### Reproduction: A simple...
Find a better example for parameterized substitution in the documentation.
Currently we have a feature called `pretty_errors` that is intended to give better error messages than without the feature. This is currently only haphazardly implemented and not automatically tested. We...
#### Fixes #
### Short Description: Enable substitution within string literals. ### Motivation: Substitution within the contents of string literals fits well with the overall functionality of `duplicate`. E.g. it could be used...
Inspired by [a reddit comment](https://www.reddit.com/r/rust/comments/11nu27e/comment/jbs82g6/?utm_source=share&utm_medium=web2x&context=3), the `module_disambiguation` should be edited to include the signed integer types and a subtitution for the body.
### Short Description: Provide `substitute` and `substitute_item` which only provide the global substitution feature of the main macros. ### Motivation: Sometimes, `duplicate` may be used only to avoid repeating something...