Skip to content

Commit de4dbee

Browse files
committed
Apply cargo fix
1 parent 3ff53db commit de4dbee

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Diff for: examples/flate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn main() {
4949
.get_matches();
5050

5151
let input_filename = matches.value_of("INPUT").unwrap();
52-
let input: Box<io::Read> = if input_filename == "-" {
52+
let input: Box<dyn io::Read> = if input_filename == "-" {
5353
Box::new(io::stdin())
5454
} else {
5555
Box::new(
@@ -59,7 +59,7 @@ fn main() {
5959
let mut input = io::BufReader::new(input);
6060

6161
let output_filename = matches.value_of("OUTPUT").unwrap();
62-
let output: Box<io::Write> = if output_filename == "-" {
62+
let output: Box<dyn io::Write> = if output_filename == "-" {
6363
Box::new(io::stdout())
6464
} else if output_filename == "/dev/null" {
6565
Box::new(io::sink())

Diff for: src/deflate/symbol.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ impl Symbol {
9999
Symbol::Literal(b) => u16::from(b),
100100
Symbol::EndOfBlock => 256,
101101
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,
108108
258 => 285,
109109
_ => unreachable!(),
110110
},
@@ -113,12 +113,12 @@ impl Symbol {
113113
pub fn extra_lengh(&self) -> Option<(u8, u16)> {
114114
if let Symbol::Share { length, .. } = *self {
115115
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)),
122122
_ => unreachable!(),
123123
}
124124
} else {
@@ -203,7 +203,7 @@ impl Decoder {
203203
{
204204
let decoded = self.literal.decode_unchecked(reader);
205205
match decoded {
206-
0...255 => Symbol::Literal(decoded as u8),
206+
0..=255 => Symbol::Literal(decoded as u8),
207207
256 => Symbol::EndOfBlock,
208208
286 | 287 => {
209209
let message = format!("The value {} must not occur in compressed data", decoded);
@@ -439,12 +439,12 @@ fn load_bitwidthes<R>(
439439
reader: &mut bit::BitReader<R>,
440440
code: u16,
441441
last: Option<u8>,
442-
) -> io::Result<Box<Iterator<Item = u8>>>
442+
) -> io::Result<Box<dyn Iterator<Item = u8>>>
443443
where
444444
R: io::Read,
445445
{
446446
Ok(match code {
447-
0...15 => Box::new(iter::once(code as u8)),
447+
0..=15 => Box::new(iter::once(code as u8)),
448448
16 => {
449449
let count = reader.read_bits(2)? + 3;
450450
let last = last.ok_or_else(|| invalid_data_error!("No preceding value"))?;

0 commit comments

Comments
 (0)