@@ -6,7 +6,6 @@ mod terminal;
66pub use list:: * ;
77pub use terminal:: * ;
88
9- use std:: iter:: repeat;
109use tui:: { self , buffer:: Buffer , layout:: Rect , style:: Color , style:: Style } ;
1110use unicode_segmentation:: UnicodeSegmentation ;
1211use unicode_width:: UnicodeWidthStr ;
@@ -15,7 +14,7 @@ pub fn fill_background_to_right(mut s: String, entire_width: u16) -> String {
1514 match ( s. len ( ) , entire_width as usize ) {
1615 ( x, y) if x >= y => s,
1716 ( x, y) => {
18- s. extend ( repeat ( ' ' ) . take ( y - x) ) ;
17+ s. extend ( std :: iter :: repeat_n ( ' ' , y - x) ) ;
1918 s
2019 }
2120 }
@@ -52,7 +51,7 @@ pub fn draw_text_with_ellipsis_nowrap(
5251 if x + 1 == bound. right ( ) {
5352 ellipsis_candidate_x = Some ( x) ;
5453 }
55- cell. set_symbol ( g. into ( ) ) ;
54+ cell. set_symbol ( g) ;
5655 if let Some ( s) = s {
5756 cell. set_style ( s) ;
5857 }
@@ -68,7 +67,7 @@ pub fn draw_text_with_ellipsis_nowrap(
6867 }
6968 }
7069 if let ( Some ( _) , Some ( x) ) = ( graphemes. next ( ) , ellipsis_candidate_x) {
71- buf. get_mut ( x, bound. y ) . set_symbol ( "…" . into ( ) ) ;
70+ buf. get_mut ( x, bound. y ) . set_symbol ( "…" ) ;
7271 }
7372 }
7473 total_width as u16
@@ -85,7 +84,7 @@ pub fn draw_text_nowrap_fn(
8584 }
8685 for ( g, x) in t. as_ref ( ) . graphemes ( true ) . zip ( bound. left ( ) ..bound. right ( ) ) {
8786 let cell = buf. get_mut ( x, bound. y ) ;
88- cell. set_symbol ( g. into ( ) ) ;
87+ cell. set_symbol ( g) ;
8988 cell. set_style ( s ( cell. symbol ( ) , x, bound. y ) ) ;
9089 }
9190}
0 commit comments