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

贡献者指南