It's hard to debug the validation function, errors often result in the entire macro invocation failing with an obscure and incorrect error:
the size for values of type `dyn std::ops::FnMut(std::string::String, hdk::ValidationData) -> std::result::Result<(), std::string::String> + std::marker::Sync` cannot be known at compilation time
doesn't have a size known at compile-time
help: the trait `std::marker::Sized` is not implemented for `dyn std::ops::FnMut(std::string::String, hdk::ValidationData) -> std::result::Result<(), std::string::String> + std::marker::Sync`
I've resorted to writing a fn with the same signature as the macro closure requires, and then just calling the function from the macro as a one-liner, so I can get normal error messages.
It's hard to debug the
validation
function, errors often result in the entire macro invocation failing with an obscure and incorrect error:I've resorted to writing a
fn
with the same signature as the macro closure requires, and then just calling the function from the macro as a one-liner, so I can get normal error messages.