Rust Macro Error: "no rules expected the token `true`"


If a macro get's an expr fragment, it won't evaluate it (even if it is a literal), so $value:expr can never match true. If you want to do value based dispatch, you can't just use macros. You'll need to use traits as well.

like this:


You are right, thank you very much!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.