@@ -5,6 +5,7 @@ use std::time::{Duration, Instant};
55
66use super :: {
77 CODSPEED_U8_COLOR_CODE , IS_TTY , SPINNER , SPINNER_TICKS , TICK_INTERVAL_MS , format_checkmark,
8+ icons:: Icon ,
89} ;
910use console:: { Term , style} ;
1011use std:: sync:: LazyLock ;
@@ -113,7 +114,7 @@ impl RollingBuffer {
113114 let title_styled = style ( & self . title ) . color256 ( CODSPEED_U8_COLOR_CODE ) ;
114115
115116 let line = format ! ( " {tick_styled} {title_styled}" ) ;
116- console:: truncate_str ( & line, self . term_width , "…" ) . into_owned ( )
117+ console:: truncate_str ( & line, self . term_width , & Icon :: Ellipsis . to_string ( ) ) . into_owned ( )
117118 }
118119
119120 fn render_top_delimiter ( & self ) -> String {
@@ -126,18 +127,18 @@ impl RollingBuffer {
126127 } else {
127128 String :: new ( )
128129 } ;
129- let prefix = format ! ( "{INDENT}\u{256d} \u{2500} " ) ;
130- let suffix = " \u{256e} " ; // ╮
130+ let prefix = format ! ( "{INDENT}{}{}" , Icon :: BoxTopLeft , Icon :: BoxHorizontal ) ;
131+ let suffix = Icon :: BoxTopRight . to_string ( ) ;
131132 let label_visible_len = if truncated > 0 {
132133 format ! ( " {truncated} lines above " ) . len ( )
133134 } else {
134135 0
135136 } ;
136137 let used = console:: measure_text_width ( & prefix)
137138 + label_visible_len
138- + console:: measure_text_width ( suffix) ;
139+ + console:: measure_text_width ( & suffix) ;
139140 let remaining = self . term_width . saturating_sub ( used) ;
140- let bar = " \u{2500} " . repeat ( remaining) ;
141+ let bar = Icon :: BoxHorizontal . to_string ( ) . repeat ( remaining) ;
141142 format ! (
142143 "{}{}{}" ,
143144 style( prefix. to_string( ) ) . dim( ) ,
@@ -147,22 +148,22 @@ impl RollingBuffer {
147148 }
148149
149150 fn render_bottom_delimiter ( & self ) -> String {
150- let prefix = format ! ( "{INDENT}\u{2570} " ) ;
151- let suffix = " \u{256f} " ; // ╯
152- let used = console:: measure_text_width ( & prefix) + console:: measure_text_width ( suffix) ;
151+ let prefix = format ! ( "{INDENT}{}" , Icon :: BoxBottomLeft ) ;
152+ let suffix = Icon :: BoxBottomRight . to_string ( ) ;
153+ let used = console:: measure_text_width ( & prefix) + console:: measure_text_width ( & suffix) ;
153154 let remaining = self . term_width . saturating_sub ( used) ;
154- let bar = " \u{2500} " . repeat ( remaining) ;
155+ let bar = Icon :: BoxHorizontal . to_string ( ) . repeat ( remaining) ;
155156 format ! ( "{}" , style( format!( "{prefix}{bar}{suffix}" ) ) . dim( ) )
156157 }
157158
158159 fn render_content_line ( & self , line : & str ) -> String {
159- let inner_indent = format ! ( "{INDENT}\u{2502 } " ) ;
160- let right_border = " \u{2502} " ; // │
160+ let inner_indent = format ! ( "{INDENT}{ } " , Icon :: BoxVertical ) ;
161+ let right_border = Icon :: BoxVertical . to_string ( ) ;
161162 let chrome_width =
162- console:: measure_text_width ( & inner_indent) + console:: measure_text_width ( right_border) ;
163+ console:: measure_text_width ( & inner_indent) + console:: measure_text_width ( & right_border) ;
163164 let max_content_width = self . term_width . saturating_sub ( chrome_width) ;
164165 let truncated = if max_content_width > 0 {
165- console:: truncate_str ( line, max_content_width, "…" )
166+ console:: truncate_str ( line, max_content_width, & Icon :: Ellipsis . to_string ( ) )
166167 } else {
167168 std:: borrow:: Cow :: Borrowed ( "" )
168169 } ;
@@ -173,7 +174,7 @@ impl RollingBuffer {
173174 style( & inner_indent) . dim( ) ,
174175 style( & * truncated) . dim( ) ,
175176 " " . repeat( padding) ,
176- style( right_border) . dim( )
177+ style( & right_border) . dim( )
177178 )
178179 }
179180
0 commit comments