Skip to content
A Rust proc_macro_attribute to outline conversions from generic functions
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Allow momo on method calls, inline outer function May 24, 2019
src Allow momo on method calls, inline outer function May 24, 2019
.gitignore Initial commit May 17, 2019
Cargo.toml fix the macro, add an example, be more lenient w/ deps versions May 21, 2019
LICENSE Initial commit May 17, 2019
README.md Initial commit May 17, 2019

README.md

momo

Keep your compile time during MOnoMOrphization

This is a proc_macro crate to help keeping the code footprint of generic methods in check. Often, generics are used in libraries to improve ergonomics. However, this has a cost in compile time and binary size. Optimally, one creates a small shell function that does the generic conversions and then calls an inner function, but that makes the code less readable.

Add a #[momo] annotation from this crate to split your function into an outer conversion and a private inner function. In return, you get some compile time for a tiny bit of runtime (if at all) – without impairing readability.

For now, the only place where we can put the #[momo] annotations is on plain functions.

You can’t perform that action at this time.