maybe-async-rs
maybe-async-rs copied to clipboard
`maybe_async` on structs
According to the readme I can apply the macro to struct definitions. However if I do this on an impl
block for a struct (without trait) I get an error due to this check: https://github.com/fMeow/maybe-async-rs/blob/b8be6e43d3f64bae52063d5b46f4e627303bc733/src/parse.rs#L26
If I apply it directly on the struct I get this error:
https://github.com/fMeow/maybe-async-rs/blob/b8be6e43d3f64bae52063d5b46f4e627303bc733/src/parse.rs#L43
I was hoping to apply the macro on a struct or its impl
in order to affect all its methods. Is there something wrong with my line of thinking? If not I could try to come up with an PR for this.
I think it fine. And I am open to an PR for this too.
But in my opinion, a better solution might be providing both async and sync methods for a struct implementation. I tried a little bit to generate both async and sync block but that could mess up compiler message when compiler erorr occurs in inner code block.