rust-lang/rust-clippy

Expand float_cmp to structs with PartialEq

Open

#1.685 aberto em 17 de abr. de 2017

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)Rust (1.391 forks)batch import
C-enhancementL-correctnessT-middlegood first issue

Métricas do repositório

Stars
 (10.406 stars)
Métricas de merge de PR
 (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)

Description

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

Guia do colaborador