rust-lang/rust-clippy

Expand float_cmp to structs with PartialEq

Open

#1,685 opened on 2017年4月17日

GitHub で見る
 (5 comments) (0 reactions) (0 assignees)Rust (1,391 forks)batch import
C-enhancementL-correctnessT-middlegood first issue

Repository metrics

Stars
 (10,406 stars)
PR merge metrics
 (平均マージ 19d 22h) (30d で 113 merged PRs)

説明

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

コントリビューターガイド