|
| 1 | +use alloc::borrow::ToOwned; |
| 2 | +use alloc::{format, vec}; |
| 3 | +use alloc::vec::Vec; |
| 4 | +use core::ops::{self, Range}; |
1 | 5 | use crate::{read_u16_from_be, read_u8}; |
2 | 6 | use error::{Error, Result, UnsupportedFeature}; |
3 | 7 | use huffman::{HuffmanTable, HuffmanTableClass}; |
4 | 8 | use marker::Marker; |
5 | 9 | use marker::Marker::*; |
6 | 10 | use std::io::{self, Read}; |
7 | | -use std::ops::Range; |
8 | 11 |
|
9 | 12 | #[derive(Clone, Copy, Debug, PartialEq)] |
10 | 13 | pub struct Dimensions { |
@@ -379,7 +382,7 @@ pub fn parse_sos<R: Read>(reader: &mut R, frame: &FrameInfo) -> Result<ScanInfo> |
379 | 382 |
|
380 | 383 | let blocks_per_mcu = component_indices.iter().map(|&i| { |
381 | 384 | frame.components[i].horizontal_sampling_factor as u32 * frame.components[i].vertical_sampling_factor as u32 |
382 | | - }).fold(0, ::std::ops::Add::add); |
| 385 | + }).fold(0, ops::Add::add); |
383 | 386 |
|
384 | 387 | if component_count > 1 && blocks_per_mcu > 10 { |
385 | 388 | return Err(Error::Format("scan with more than one component and more than 10 blocks per MCU".to_owned())); |
@@ -537,7 +540,7 @@ pub fn parse_dht<R: Read>(reader: &mut R, is_baseline: Option<bool>) -> Result<( |
537 | 540 | let mut counts = [0u8; 16]; |
538 | 541 | reader.read_exact(&mut counts)?; |
539 | 542 |
|
540 | | - let size = counts.iter().map(|&val| val as usize).fold(0, ::std::ops::Add::add); |
| 543 | + let size = counts.iter().map(|&val| val as usize).fold(0, ops::Add::add); |
541 | 544 |
|
542 | 545 | if size == 0 { |
543 | 546 | return Err(Error::Format("encountered table with zero length in DHT".to_owned())); |
|
0 commit comments