rust-lang/rust-clippy

Expand float_cmp to structs with PartialEq

Open

#1,685 创建于 2017年4月17日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Rust (1,391 fork)batch import
C-enhancementL-correctnessT-middlegood first issue

仓库指标

Star
 (10,406 star)
PR 合并指标
 (平均合并 19天 22小时) (30 天内合并 113 个 PR)

描述

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

贡献者指南