Clippy fixes

This commit is contained in:
gaxler
2021-01-30 19:55:04 -08:00
parent 2f03c1d6d7
commit ca0816db97
3 changed files with 9 additions and 10 deletions
+2 -1
View File
@@ -65,6 +65,7 @@ pub fn make_one_hot<T: RealNumber, V: BaseVector<T>>(
/// println!("{:?}", enc_lv.get_categories());
/// assert_eq!(enc_lv.transform_one::<f64>(&"dog"), enc_lm.transform_one::<f64>(&"dog"))
/// ```
#[derive(Debug, Clone)]
pub struct SeriesOneHotEncoder<CategoryType> {
category_map: HashMap<CategoryType, usize>,
categories: Vec<CategoryType>,
@@ -134,7 +135,7 @@ impl<'a, CategoryType: 'a + Hash + Eq + Clone> SeriesOneHotEncoder<CategoryType>
&self,
categories: &'a [CategoryType],
) -> Vec<Option<Vec<U>>> {
let v = categories.iter().map(|a| a.clone());
let v = categories.iter().cloned();
self.transform_iter(v)
}