File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11use clap:: Parser ;
22use regex:: Regex ;
33use std:: i64;
4+ use colored:: Colorize ;
45
56const HEX_PATTERN : & str = r"^0x[0-9a-fA-F]+$" ;
67const DEC_PATTERN : & str = r"^-?[0-9]+$" ;
@@ -23,9 +24,9 @@ fn main() {
2324}
2425
2526fn display_number_formats ( value : i64 ) {
26- println ! ( "{}" , FORMAT_DEC . replace( "{:#}" , & value. to_string( ) ) ) ;
27- println ! ( "{}" , FORMAT_HEX . replace( "{:#x}" , & format!( "{:#x}" , value) ) ) ;
28- println ! ( "{}" , FORMAT_BIN . replace( "{:#b}" , & format!( "{:#b}" , value) ) ) ;
27+ println ! ( "{}" , FORMAT_DEC . replace( "{:#}" , & value. to_string( ) ) . bright_green ( ) ) ;
28+ println ! ( "{}" , FORMAT_HEX . replace( "{:#x}" , & format!( "{:#x}" , value) ) . bright_cyan ( ) ) ;
29+ println ! ( "{}" , FORMAT_BIN . replace( "{:#b}" , & format!( "{:#b}" , value) ) . bright_magenta ( ) ) ;
2930}
3031
3132fn handle_parse_error ( error : anyhow:: Error ) -> ! {
You can’t perform that action at this time.
0 commit comments