llogiq / momo

A Rust proc_macro_attribute to outline conversions from generic functions
Apache License 2.0
263 stars 8 forks source link

Option for syn/quote #10

Open tjkirch opened 4 years ago

tjkirch commented 4 years ago

I appreciate the reasons for converting to watt, but if I have software that already includes syn/quote or whose compile time dominates that of syn/quote, it would be nice to use it rather than including watt and needing a wasm toolchain.

dtolnay commented 4 years ago

FWIW you don't need a wasm toolchain to use watt based macros. (But this is very unclear from the momo readme.)

Try it:

[package]
name = "demo"
version = "0.0.0"
edition = "2018"

[dependencies]
momo = "0.2"
use momo::momo;

#[momo]
fn demo<S: AsRef<str>>(arg: S) {
    println!("{}", arg);
}

fn main() {}