File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ fn main() -> Result<()> {
12
12
// read from stdin
13
13
None => {
14
14
let mut line = String :: new ( ) ;
15
- std:: io:: stdin ( ) . read_line ( & mut line) . unwrap ( ) ;
15
+ std:: io:: stdin ( ) . read_line ( & mut line) ? ;
16
16
line
17
17
}
18
18
} ;
@@ -25,17 +25,17 @@ fn parse_string(content: &str) -> Result<()> {
25
25
26
26
while let Some ( b) = bytes. next ( ) {
27
27
if b & 0x80 == 0 {
28
- // if MSB is 0, is is ASCII.
28
+ // if MSB is 0, is is just ASCII.
29
29
println ! (
30
- "{} {} {} (U+{:04X})" ,
30
+ "{} {} {} (U+{:04X} ASCII={} )" ,
31
31
"├" . bright_black( ) ,
32
32
format!( "{:08b}" , b) . cyan( ) ,
33
- std:: str :: from_utf8( & [ b] )
34
- . unwrap( )
33
+ std:: str :: from_utf8( & [ b] ) ?
35
34
. replace( "\x0a " , "↵" )
36
35
. replace( "\x20 " , "<space>" )
37
36
. bold( ) ,
38
- b
37
+ b,
38
+ b,
39
39
) ;
40
40
} else {
41
41
let nb = ( !b) . leading_zeros ( ) ;
You can’t perform that action at this time.
0 commit comments