I am still learning Rust and afaiu, with the macro_rules!
syntax there is no way to match on the arity of a passed function, or is there a clever way to compose multiple macro's to get this behavior?
I am trying to DRY on a common pattern where I want to pass in a function that sometimes takes self
. The simplest solution is to have all functions that will be passed to the macro to take an potentially unused self
, but are there any other, more elegant solutions?
Thank you!