From ab0a7cb447ea68db0cc856ad7de97342fd76bd48 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Mon, 2 Jan 2023 22:25:29 +0100 Subject: [PATCH] Follow clippy warnings --- src/factor_graph.rs | 2 +- src/lib.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/factor_graph.rs b/src/factor_graph.rs index 57663ef..448c759 100644 --- a/src/factor_graph.rs +++ b/src/factor_graph.rs @@ -7,7 +7,7 @@ use log::*; use crate::gaussian::Gaussian; use crate::math; -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct VariableId { index: usize, } diff --git a/src/lib.rs b/src/lib.rs index fda51b8..297380a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::unreadable_literal, clippy::excessive_precision)] -#![warn(rust_2018_idioms)] mod factor_graph; mod gaussian; @@ -234,7 +233,7 @@ impl TrueSkill { ranks[i] == ranks[i + 1], ) }) - .collect::>();; + .collect::>(); for factor in &rating_layer { factor.start(&mut variable_arena); @@ -328,15 +327,16 @@ impl TrueSkill { for n in t..t + current.len() { rotated_a_matrix[(row, n)] = flatten_weights[n]; - t += 1; x += 1; } + t += current.len(); + for n in x..x + next.len() { rotated_a_matrix[(row, n)] = -flatten_weights[n]; - - x += 1; } + + x += next.len(); } let a_matrix = rotated_a_matrix.transpose();