File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,15 @@ static LIMIT: f64 = 2.0;
2121fn main ( ) {
2222 let args = std:: os:: args ( ) ;
2323 let ( w, mut out) = if args. len ( ) < 2 {
24- println ( "Test mode: do not dump the image." ) ;
24+ println ( "Test mode: do not dump the image because it's not utf8,"
25+ + " which interferes with the test runner." ) ;
2526 ( 1000 , ~DummyWriter as ~Writer )
2627 } else {
2728 ( from_str ( args[ 1 ] ) . unwrap ( ) ,
2829 ~BufferedWriter :: new ( std:: io:: stdout ( ) ) as ~Writer )
2930 } ;
3031 let h = w;
31- let mut byte_acc = 0i8 ;
32+ let mut byte_acc = 0u8 ;
3233 let mut bit_num = 0 ;
3334
3435 writeln ! ( out, "P4\n {} {}" , w, h) ;
@@ -62,12 +63,12 @@ fn main() {
6263 bit_num += 1 ;
6364
6465 if bit_num == 8 {
65- out. write_i8 ( byte_acc) ;
66+ out. write_u8 ( byte_acc) ;
6667 byte_acc = 0 ;
6768 bit_num = 0 ;
6869 } else if x == w - 1 {
6970 byte_acc <<= 8 - w % 8 ;
70- out. write_i8 ( byte_acc) ;
71+ out. write_u8 ( byte_acc) ;
7172 byte_acc = 0 ;
7273 bit_num = 0 ;
7374 }
You can’t perform that action at this time.
0 commit comments