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

貢獻者指南