Skip to content

Commit 8ca5d9e

Browse files
committed
chore: Apply clippy
1 parent e53cc8b commit 8ca5d9e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/bar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ impl WrappedBar {
6464

6565
fn compute_position(&mut self) -> f64 {
6666
let previous_pos = self.output.position();
67-
let pos = std::io::stdin()
67+
68+
std::io::stdin()
6869
.lines()
6970
.next()
7071
.unwrap_or_else(|| Ok(previous_pos.to_string()))
7172
.unwrap()
7273
.parse::<f64>()
73-
.unwrap_or(previous_pos as f64);
74-
pos
74+
.unwrap_or(previous_pos as f64)
7575
}
7676

7777
fn set_minmax(&mut self, pos: f64) {

src/colorizer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ pub fn run<'a>(
66
regex: &'a str,
77
colors: &'a str,
88
) -> Result<Vec<ColoredString>, &'static str> {
9-
if regex.len() > 0 && colors.len() > 0 {
10-
return colorize(input, regex, colors);
9+
if !regex.is_empty() && !colors.is_empty() {
10+
colorize(input, regex, colors)
1111
} else {
1212
let num_commas = input.chars().filter(|&c| c == ',').count();
1313
let num_spaces = input.chars().filter(|&c| c == ' ').count();
@@ -33,7 +33,7 @@ pub fn run<'a>(
3333
regex.push_str(" \\s*(.*)");
3434
}
3535

36-
colors.push_str(" ");
36+
colors.push(' ');
3737
colors.push_str(&possible_colors[(i + 1) % possible_colors.len()]);
3838
}
3939
colorize(input, &regex, &colors)

0 commit comments

Comments
 (0)