File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use bytes::{BufMut, BytesMut};
77
88// Constructed in the generated `table.rs` file
99struct Decoder {
10- state : usize ,
10+ state : u8 ,
1111 maybe_eos : bool ,
1212}
1313
@@ -76,7 +76,7 @@ impl Decoder {
7676 // Decodes 4 bits
7777 fn decode4 ( & mut self , input : u8 ) -> Result < Option < u8 > , DecoderError > {
7878 // (next-state, byte, flags)
79- let ( next, byte, flags) = DECODE_TABLE [ self . state ] [ input as usize ] ;
79+ let ( next, byte, flags) = DECODE_TABLE [ self . state as usize ] [ input as usize ] ;
8080
8181 if flags & ERROR == ERROR {
8282 // Data followed the EOS marker
Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ pub const ENCODE_TABLE: [(usize, u64); 257] = [
262262] ;
263263
264264// (next-state, byte, flags)
265- pub const DECODE_TABLE : [ [ ( usize , u8 , u8 ) ; 16 ] ; 256 ] = [
265+ pub const DECODE_TABLE : [ [ ( u8 , u8 , u8 ) ; 16 ] ; 256 ] = [
266266 // 0
267267 [
268268 ( 4 , 0 , 0x00 ) ,
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ pub fn main() {
249249
250250 println ! ( ) ;
251251 println ! ( "// (next-state, byte, flags)" ) ;
252- println ! ( "pub const DECODE_TABLE: [[(usize , u8, u8); 16]; 256] = [" ) ;
252+ println ! ( "pub const DECODE_TABLE: [[(u8 , u8, u8); 16]; 256] = [" ) ;
253253
254254 decode. print ( ) ;
255255
You can’t perform that action at this time.
0 commit comments