Skip to content

Commit a643c46

Browse files
committed
lint: Applied clippy lints
1 parent 470d0d9 commit a643c46

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/models/common.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::repr::{ColumnType, Data};
2-
use std::{collections::HashSet, fmt::Debug, isize};
2+
use std::{collections::HashSet, fmt::Debug};
33

44
#[derive(Debug, Clone, PartialEq)]
55
pub struct Point<X = Data, Y = Data> {
@@ -224,11 +224,7 @@ impl Scale {
224224

225225
pub fn points(&self) -> Vec<Data> {
226226
match &self.values {
227-
ScaleValues::Text(values) => values
228-
.iter()
229-
.cloned()
230-
.map(|value| Data::Text(value))
231-
.collect(),
227+
ScaleValues::Text(values) => values.iter().cloned().map(Data::Text).collect(),
232228
ScaleValues::Number { start, step, .. } => {
233229
let mut output = Vec::default();
234230
let n = self.length as isize;
@@ -416,8 +412,6 @@ impl Scale {
416412
let mut seen = Vec::default();
417413

418414
for point in points {
419-
let point = point;
420-
421415
if !seen.iter().any(|pnt| *pnt == point) {
422416
seen.push(point);
423417
}
@@ -484,19 +478,19 @@ impl Scale {
484478

485479
impl From<Vec<i32>> for Scale {
486480
fn from(value: Vec<i32>) -> Self {
487-
Self::new(value.into_iter(), ScaleKind::Integer)
481+
Self::new(value, ScaleKind::Integer)
488482
}
489483
}
490484

491485
impl From<Vec<isize>> for Scale {
492486
fn from(value: Vec<isize>) -> Self {
493-
Self::new(value.into_iter(), ScaleKind::Number)
487+
Self::new(value, ScaleKind::Number)
494488
}
495489
}
496490

497491
impl From<Vec<f32>> for Scale {
498492
fn from(value: Vec<f32>) -> Self {
499-
Self::new(value.into_iter(), ScaleKind::Float)
493+
Self::new(value, ScaleKind::Float)
500494
}
501495
}
502496

@@ -599,9 +593,6 @@ mod tests {
599593
let mut scale = Scale::new(pnts, ScaleKind::Integer);
600594
scale.sort();
601595

602-
println!("{scale:?}");
603-
println!("{:?}", scale.points());
604-
605596
assert_eq!(scale.length, 4);
606597
assert_eq!(
607598
scale.points(),

src/repr/sheet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ impl Sheet {
12301230
Scale::new(x_values, kind.into())
12311231
};
12321232

1233-
let y_scale = Scale::new(y_values.into_iter(), y_kind);
1233+
let y_scale = Scale::new(y_values, y_kind);
12341234

12351235
let acc_labels = acc_labels.into_iter().collect();
12361236

0 commit comments

Comments
 (0)