rust-lang/rust-clippy

Expand float_cmp to structs with PartialEq

Open

#1,685 建立於 2017年4月17日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)Rust (10,406 star) (1,391 fork)batch import
C-enhancementL-correctnessT-middlegood first issue

描述

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);
}

貢獻者指南