Fixed clippy warnings
This commit is contained in:
@@ -2,7 +2,7 @@ use std::error;
|
||||
use std::ffi::NulError;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum Error {
|
||||
Io,
|
||||
Parameter(String),
|
||||
|
||||
@@ -37,6 +37,12 @@ impl Matrix {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Matrix {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::Matrix;
|
||||
|
||||
@@ -77,7 +77,7 @@ impl Model {
|
||||
let end_index = factors as usize * (row_index as usize + 1);
|
||||
return Some(&self.p_factors()[start_index..end_index]);
|
||||
}
|
||||
return None;
|
||||
None
|
||||
}
|
||||
|
||||
pub fn q(&self, column_index: i32) -> Option<&[f32]> {
|
||||
@@ -87,7 +87,7 @@ impl Model {
|
||||
let end_index = factors as usize * (column_index as usize + 1);
|
||||
return Some(&self.q_factors()[start_index..end_index]);
|
||||
}
|
||||
return None;
|
||||
None
|
||||
}
|
||||
|
||||
pub fn rmse(&self, data: &Matrix) -> f64 {
|
||||
|
||||
Reference in New Issue
Block a user