File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,22 @@ pub fn capitalize_first(s: &str) -> String {
1111 let mut chars = s. chars ( ) ;
1212 match chars. next ( ) {
1313 None => String :: new ( ) ,
14- Some ( first) => first. to_uppercase ( ) . collect :: < String > ( ) + chars. as_str ( ) ,
14+ Some ( first) => {
15+ let mut result = first. to_uppercase ( ) . collect :: < String > ( ) ;
16+ result. push_str ( chars. as_str ( ) ) ;
17+ result
18+ }
1519 }
1620}
1721
1822pub fn format_elapsed_time ( elapsed_ms : u64 ) -> String {
1923 let elapsed_s = elapsed_ms / 1000 ;
2024 if elapsed_s < 60 {
21- format ! ( "{}s" , elapsed_s )
25+ format ! ( "{elapsed_s }s" )
2226 } else {
2327 let minutes = elapsed_s / 60 ;
2428 let seconds = elapsed_s % 60 ;
25- format ! ( "{}m {}s" , minutes , seconds )
29+ format ! ( "{minutes }m {seconds }s" )
2630 }
2731}
2832
@@ -37,7 +41,7 @@ pub fn display_turn_usage_summary<W: Write>(
3741 for usage in totals {
3842 let formatted = format_number ( usage. value ) ;
3943 let capitalized_unit = capitalize_first ( & usage. unit_plural ) ;
40- parts. push ( format ! ( "{} used: {}" , capitalized_unit , formatted ) ) ;
44+ parts. push ( format ! ( "{capitalized_unit } used: {formatted}" ) ) ;
4145 }
4246
4347 // Add elapsed time
You can’t perform that action at this time.
0 commit comments