@@ -99,12 +99,12 @@ impl Symbol {
99
99
Symbol :: Literal ( b) => u16:: from ( b) ,
100
100
Symbol :: EndOfBlock => 256 ,
101
101
Symbol :: Share { length, .. } => match length {
102
- 3 ... 10 => 257 + length - 3 ,
103
- 11 ... 18 => 265 + ( length - 11 ) / 2 ,
104
- 19 ... 34 => 269 + ( length - 19 ) / 4 ,
105
- 35 ... 66 => 273 + ( length - 35 ) / 8 ,
106
- 67 ... 130 => 277 + ( length - 67 ) / 16 ,
107
- 131 ... 257 => 281 + ( length - 131 ) / 32 ,
102
+ 3 ..= 10 => 257 + length - 3 ,
103
+ 11 ..= 18 => 265 + ( length - 11 ) / 2 ,
104
+ 19 ..= 34 => 269 + ( length - 19 ) / 4 ,
105
+ 35 ..= 66 => 273 + ( length - 35 ) / 8 ,
106
+ 67 ..= 130 => 277 + ( length - 67 ) / 16 ,
107
+ 131 ..= 257 => 281 + ( length - 131 ) / 32 ,
108
108
258 => 285 ,
109
109
_ => unreachable ! ( ) ,
110
110
} ,
@@ -113,12 +113,12 @@ impl Symbol {
113
113
pub fn extra_lengh ( & self ) -> Option < ( u8 , u16 ) > {
114
114
if let Symbol :: Share { length, .. } = * self {
115
115
match length {
116
- 3 ... 10 | 258 => None ,
117
- 11 ... 18 => Some ( ( 1 , ( length - 11 ) % 2 ) ) ,
118
- 19 ... 34 => Some ( ( 2 , ( length - 19 ) % 4 ) ) ,
119
- 35 ... 66 => Some ( ( 3 , ( length - 35 ) % 8 ) ) ,
120
- 67 ... 130 => Some ( ( 4 , ( length - 67 ) % 16 ) ) ,
121
- 131 ... 257 => Some ( ( 5 , ( length - 131 ) % 32 ) ) ,
116
+ 3 ..= 10 | 258 => None ,
117
+ 11 ..= 18 => Some ( ( 1 , ( length - 11 ) % 2 ) ) ,
118
+ 19 ..= 34 => Some ( ( 2 , ( length - 19 ) % 4 ) ) ,
119
+ 35 ..= 66 => Some ( ( 3 , ( length - 35 ) % 8 ) ) ,
120
+ 67 ..= 130 => Some ( ( 4 , ( length - 67 ) % 16 ) ) ,
121
+ 131 ..= 257 => Some ( ( 5 , ( length - 131 ) % 32 ) ) ,
122
122
_ => unreachable ! ( ) ,
123
123
}
124
124
} else {
@@ -203,7 +203,7 @@ impl Decoder {
203
203
{
204
204
let decoded = self . literal . decode_unchecked ( reader) ;
205
205
match decoded {
206
- 0 ... 255 => Symbol :: Literal ( decoded as u8 ) ,
206
+ 0 ..= 255 => Symbol :: Literal ( decoded as u8 ) ,
207
207
256 => Symbol :: EndOfBlock ,
208
208
286 | 287 => {
209
209
let message = format ! ( "The value {} must not occur in compressed data" , decoded) ;
@@ -439,12 +439,12 @@ fn load_bitwidthes<R>(
439
439
reader : & mut bit:: BitReader < R > ,
440
440
code : u16 ,
441
441
last : Option < u8 > ,
442
- ) -> io:: Result < Box < Iterator < Item = u8 > > >
442
+ ) -> io:: Result < Box < dyn Iterator < Item = u8 > > >
443
443
where
444
444
R : io:: Read ,
445
445
{
446
446
Ok ( match code {
447
- 0 ... 15 => Box :: new ( iter:: once ( code as u8 ) ) ,
447
+ 0 ..= 15 => Box :: new ( iter:: once ( code as u8 ) ) ,
448
448
16 => {
449
449
let count = reader. read_bits ( 2 ) ? + 3 ;
450
450
let last = last. ok_or_else ( || invalid_data_error ! ( "No preceding value" ) ) ?;
0 commit comments