Skip to content

Commit 8e220fd

Browse files
devmatteinidjc
authored andcommitted
Fix clippy lints
1 parent 5b8b905 commit 8e220fd

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/in_memory.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl TermLike for InMemoryTerm {
6767
.state
6868
.lock()
6969
.unwrap()
70-
.write_str(&*format!("\x1b[{}A", n)),
70+
.write_str(&format!("\x1b[{}A", n)),
7171
}
7272
}
7373

@@ -78,7 +78,7 @@ impl TermLike for InMemoryTerm {
7878
.state
7979
.lock()
8080
.unwrap()
81-
.write_str(&*format!("\x1b[{}B", n)),
81+
.write_str(&format!("\x1b[{}B", n)),
8282
}
8383
}
8484

@@ -89,7 +89,7 @@ impl TermLike for InMemoryTerm {
8989
.state
9090
.lock()
9191
.unwrap()
92-
.write_str(&*format!("\x1b[{}C", n)),
92+
.write_str(&format!("\x1b[{}C", n)),
9393
}
9494
}
9595

@@ -100,7 +100,7 @@ impl TermLike for InMemoryTerm {
100100
.state
101101
.lock()
102102
.unwrap()
103-
.write_str(&*format!("\x1b[{}D", n)),
103+
.write_str(&format!("\x1b[{}D", n)),
104104
}
105105
}
106106

src/style.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,7 @@ impl ProgressStyle {
190190
let entirely_filled = fill as usize;
191191
// 1 if the bar is not entirely empty or full (meaning we need to draw the "current"
192192
// character between the filled and "to do" segment), 0 otherwise.
193-
let head = if fill > 0.0 && entirely_filled < width {
194-
1
195-
} else {
196-
0
197-
};
193+
let head = usize::from(fill > 0.0 && entirely_filled < width);
198194

199195
let cur = if head == 1 {
200196
// Number of fine-grained progress entries in progress_chars.
@@ -423,7 +419,7 @@ impl<'a> WideElement<'a> {
423419
buf: &mut String,
424420
width: u16,
425421
) -> String {
426-
let left = (width as usize).saturating_sub(measure_text_width(&*cur.replace('\x00', "")));
422+
let left = (width as usize).saturating_sub(measure_text_width(&cur.replace('\x00', "")));
427423
match self {
428424
Self::Bar { alt_style } => cur.replace(
429425
'\x00',

0 commit comments

Comments
 (0)