Crate of the Week

I'd like to nominate duplicate: an (almost) zero-dependency proc macro crate, which allows easy parametric code duplication. No more writing ad hoc macro_rules! with broken formatting and intellisense! This crate allows you to write your functions, types and impls as normal, with all the usual tooling benefits, and substitute certain identifiers with multiple (token) expressions.

This is particularly invaluable when writing tests for various integer types. No longer do you need to choose between readability and code deduplication!

11 Likes