@@ -27,9 +27,8 @@ use crate::ui::text_colors::TextColors;
2727use anyhow:: { Context , Result } ;
2828use gix:: sec:: trust:: Mapping ;
2929use gix:: Repository ;
30- use num_format:: ToFormattedString ;
3130use onefetch_manifest:: Manifest ;
32- use owo_colors:: { DynColors , OwoColorize , Style } ;
31+ use owo_colors:: { DynColors , OwoColorize } ;
3332use serde:: Serialize ;
3433use std:: path:: Path ;
3534
@@ -409,14 +408,6 @@ impl InfoBuilder {
409408 }
410409}
411410
412- fn get_style ( is_bold : bool , color : DynColors ) -> Style {
413- let mut style = Style :: new ( ) . color ( color) ;
414- if is_bold {
415- style = style. bold ( ) ;
416- }
417- style
418- }
419-
420411fn get_manifest ( repo_path : & Path ) -> Result < Option < Manifest > > {
421412 let manifests = onefetch_manifest:: get_manifests ( repo_path) ?;
422413
@@ -433,51 +424,3 @@ pub fn get_work_dir(repo: &gix::Repository) -> Result<std::path::PathBuf> {
433424 . context ( "please run onefetch inside of a non-bare git repository" ) ?
434425 . to_owned ( ) )
435426}
436-
437- fn format_number < T : ToFormattedString + std:: fmt:: Display > (
438- number : & T ,
439- number_separator : NumberSeparator ,
440- ) -> String {
441- number. to_formatted_string ( & number_separator. get_format ( ) )
442- }
443-
444- #[ cfg( test) ]
445- mod tests {
446- use super :: * ;
447- use owo_colors:: AnsiColors ;
448-
449- #[ test]
450- fn test_get_style ( ) {
451- let style = get_style ( true , DynColors :: Ansi ( AnsiColors :: Cyan ) ) ;
452- assert_eq ! (
453- style,
454- Style :: new( ) . color( DynColors :: Ansi ( AnsiColors :: Cyan ) ) . bold( )
455- ) ;
456- }
457-
458- #[ test]
459- fn test_get_style_no_bold ( ) {
460- let style = get_style ( false , DynColors :: Ansi ( AnsiColors :: Cyan ) ) ;
461- assert_eq ! ( style, Style :: new( ) . color( DynColors :: Ansi ( AnsiColors :: Cyan ) ) ) ;
462- }
463-
464- #[ test]
465- fn test_format_number ( ) {
466- assert_eq ! (
467- & format_number( & 1_000_000 , NumberSeparator :: Comma ) ,
468- "1,000,000"
469- ) ;
470- assert_eq ! (
471- & format_number( & 1_000_000 , NumberSeparator :: Space ) ,
472- "1\u{202f} 000\u{202f} 000"
473- ) ;
474- assert_eq ! (
475- & format_number( & 1_000_000 , NumberSeparator :: Underscore ) ,
476- "1_000_000"
477- ) ;
478- assert_eq ! (
479- & format_number( & 1_000_000 , NumberSeparator :: Plain ) ,
480- "1000000"
481- ) ;
482- }
483- }
0 commit comments