Detect and reject method impl without body.
Fixes #39
This is some ugly Rust. I have always found the interaction of if and if let to be a bit awkward. I'm very interested in seeing how you clean this up.
Love fehler. Totally agree with your arguments in your article.
Instead of rejecting it, could we make it generate a modified method signature with no body?
Also, it's not ugly. :) Manipulating Rust's very complex AST just requires code like this to handle all of the special cases.
I frequently want to write code like 'if let Some(foo) = bar && foo.blah() != 3' but I can't, so I have to nest another if inside it which complicates the data flow in a way that I find less functional and therefore a little less clear. I was kind of hoping you'd "clean it up" and I'd see how you handle this. You have a lot more Rust experience than I do.
There's not really a better way around it. Well, for the example you gave, this could be more elegant:
match bar {
Some(foo) if foo.blah() != 3 => { ... }
_ => {}
}
But in cases like this one, where the conditional is not the binding from the match, that would be confusing.