File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments