Open leonardo-m opened 7 years ago
Most of what you propose look a lot like abstract interpretation with octagonal domains. We don't do that yet, but it would be an interesting project.
For a more advanced version of this, clippy should also notice thatif x.is_some()
and if let Some(y) = x
are basically the same
fn foo(o: Option<String>) {
if o.is_some() {
// some code
if let Some(s) = o { // same as previous cond
// some more code
}
}
}
I'd like Clippy to spot situations like this, here the second "if" condition is useless: