Follow clippy warnings

This commit is contained in:
2023-01-02 22:25:29 +01:00
parent f923f204b3
commit ab0a7cb447
2 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ use log::*;
use crate::gaussian::Gaussian; use crate::gaussian::Gaussian;
use crate::math; use crate::math;
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct VariableId { pub struct VariableId {
index: usize, index: usize,
} }

View File

@@ -1,5 +1,4 @@
#![allow(clippy::unreadable_literal, clippy::excessive_precision)] #![allow(clippy::unreadable_literal, clippy::excessive_precision)]
#![warn(rust_2018_idioms)]
mod factor_graph; mod factor_graph;
mod gaussian; mod gaussian;
@@ -234,7 +233,7 @@ impl TrueSkill {
ranks[i] == ranks[i + 1], ranks[i] == ranks[i + 1],
) )
}) })
.collect::<Vec<_>>();; .collect::<Vec<_>>();
for factor in &rating_layer { for factor in &rating_layer {
factor.start(&mut variable_arena); factor.start(&mut variable_arena);
@@ -328,15 +327,16 @@ impl TrueSkill {
for n in t..t + current.len() { for n in t..t + current.len() {
rotated_a_matrix[(row, n)] = flatten_weights[n]; rotated_a_matrix[(row, n)] = flatten_weights[n];
t += 1;
x += 1; x += 1;
} }
t += current.len();
for n in x..x + next.len() { for n in x..x + next.len() {
rotated_a_matrix[(row, n)] = -flatten_weights[n]; rotated_a_matrix[(row, n)] = -flatten_weights[n];
x += 1;
} }
x += next.len();
} }
let a_matrix = rotated_a_matrix.transpose(); let a_matrix = rotated_a_matrix.transpose();