rust-lang/rust-clippy

Expand float_cmp to structs with PartialEq

Open

#1685 aperta il 17 apr 2017

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Rust (1391 fork)batch import
C-enhancementL-correctnessT-middlegood first issue

Metriche repository

Star
 (10.406 star)
Metriche merge PR
 (Merge medio 19g 22h) (113 PR mergiate in 30 g)

Descrizione

Example:

#[derive(PartialEq)]
struct Data {
    v: f64,
}

fn main() {
    let d1 = Data { v: 1.0 };
    let d2 = Data { v: 2.0 };

    // here should be a warning
    println!("{}", d1 == d2);
}

Guida contributor