rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.14k stars 1.58k forks source link

Rename apply_demorgan_iterator #18203

Open dev-ardi opened 6 days ago

dev-ardi commented 6 days ago
fn main() {
    let arr = [1, 2, 3];
    if !arr.into_iter().any(|num| num == 4) {
        println!("foo");
    }
}

Apply De Morgan's law to Iterator::any

This name is not very descriptive if you don't know what the De Morgan's law is.

Veykril commented 6 days ago

Do you have a better way to label this? I don't think you can express that succinctly in better ways, and De Morgan's law is a fairly easily searchable term so I don't think its too bad to name in the label here.

dev-ardi commented 2 days ago

Hmm something like "replace any for all and invert the condition"?

ChayimFriedman2 commented 2 days ago

Hmm something like "replace any for all and invert the condition"?

That's too long for me.

dev-ardi commented 2 days ago

It's not much longer than the current:

Replace any for all and invert the condition

Apply De Morgan's law to Iterator::any