Skip to content

Commit 3f85d49

Browse files
author
HeroicKatora
authored
Merge pull request #225 from vstroebel/edition_2018
Update to edition 2018
2 parents 18350e0 + e41ea73 commit 3f85d49

File tree

9 files changed

+36
-35
lines changed

9 files changed

+36
-35
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
keywords = ["jpeg", "jpg", "decoder", "image"]
1010
license = "MIT / Apache-2.0"
1111
exclude = ["tests/*"]
12+
edition = "2018"
1213

1314
[dependencies]
1415
rayon = { version = "1.0", optional = true }

src/decoder.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
use crate::read_u8;
21
use alloc::borrow::ToOwned;
32
use alloc::sync::Arc;
43
use alloc::vec::Vec;
54
use alloc::{format, vec};
65
use core::cmp;
76
use core::mem;
87
use core::ops::Range;
9-
use error::{Error, Result, UnsupportedFeature};
10-
use huffman::{fill_default_mjpeg_tables, HuffmanDecoder, HuffmanTable};
11-
use marker::Marker;
12-
use parser::{
8+
use std::convert::TryInto;
9+
use std::io::Read;
10+
use crate::read_u8;
11+
use crate::error::{Error, Result, UnsupportedFeature};
12+
use crate::huffman::{fill_default_mjpeg_tables, HuffmanDecoder, HuffmanTable};
13+
use crate::marker::Marker;
14+
use crate::parser::{
1315
parse_app, parse_com, parse_dht, parse_dqt, parse_dri, parse_sof, parse_sos,
1416
AdobeColorTransform, AppData, CodingProcess, Component, Dimensions, EntropyCoding, FrameInfo,
1517
IccChunk, ScanInfo,
1618
};
17-
use std::convert::TryInto;
18-
use std::io::Read;
19-
use upsampler::Upsampler;
20-
use worker::{PlatformWorker, RowData, Worker};
19+
use crate::upsampler::Upsampler;
20+
use crate::worker::{PlatformWorker, RowData, Worker};
2121

2222
pub const MAX_COMPONENTS: usize = 4;
2323

src/decoder/lossless.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use decoder::{Decoder, MAX_COMPONENTS};
2-
use error::{Error, Result};
3-
use huffman::HuffmanDecoder;
4-
use marker::Marker;
5-
use parser::Predictor;
6-
use parser::{Component, FrameInfo, ScanInfo};
71
use std::io::Read;
2+
use crate::decoder::{Decoder, MAX_COMPONENTS};
3+
use crate::error::{Error, Result};
4+
use crate::huffman::HuffmanDecoder;
5+
use crate::marker::Marker;
6+
use crate::parser::Predictor;
7+
use crate::parser::{Component, FrameInfo, ScanInfo};
88

99
impl<R: Read> Decoder<R> {
1010
/// decode_scan_lossless

src/huffman.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use alloc::borrow::ToOwned;
22
use alloc::vec;
33
use alloc::vec::Vec;
44
use core::iter;
5-
use crate::read_u8;
6-
use error::{Error, Result};
7-
use marker::Marker;
8-
use parser::ScanInfo;
95
use std::io::Read;
6+
use crate::read_u8;
7+
use crate::error::{Error, Result};
8+
use crate::marker::Marker;
9+
use crate::parser::ScanInfo;
1010

1111
const LUT_BITS: u8 = 8;
1212

src/parser.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use alloc::borrow::ToOwned;
22
use alloc::{format, vec};
33
use alloc::vec::Vec;
44
use core::ops::{self, Range};
5-
use crate::{read_u16_from_be, read_u8};
6-
use error::{Error, Result, UnsupportedFeature};
7-
use huffman::{HuffmanTable, HuffmanTableClass};
8-
use marker::Marker;
9-
use marker::Marker::*;
105
use std::io::{self, Read};
6+
use crate::{read_u16_from_be, read_u8};
7+
use crate::error::{Error, Result, UnsupportedFeature};
8+
use crate::huffman::{HuffmanTable, HuffmanTableClass};
9+
use crate::marker::Marker;
10+
use crate::marker::Marker::*;
1111

1212
#[derive(Clone, Copy, Debug, PartialEq)]
1313
pub struct Dimensions {

src/upsampler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use alloc::boxed::Box;
22
use alloc::vec;
33
use alloc::vec::Vec;
4-
use error::{Error, Result, UnsupportedFeature};
5-
use parser::Component;
4+
use crate::error::{Error, Result, UnsupportedFeature};
5+
use crate::parser::Component;
66

77
pub struct Upsampler {
88
components: Vec<UpsamplerComponent>,

src/worker/immediate.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use alloc::vec;
22
use alloc::vec::Vec;
33
use core::mem;
44
use core::convert::TryInto;
5-
use decoder::MAX_COMPONENTS;
6-
use error::Result;
7-
use idct::dequantize_and_idct_block;
8-
use alloc::sync::Arc;
9-
use parser::Component;
5+
use crate::decoder::MAX_COMPONENTS;
6+
use crate::error::Result;
7+
use crate::idct::dequantize_and_idct_block;
8+
use crate::alloc::sync::Arc;
9+
use crate::parser::Component;
1010
use super::{RowData, Worker};
1111

1212
pub struct ImmediateWorker {

src/worker/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ pub use self::immediate::ImmediateWorker as PlatformWorker;
88

99
use alloc::sync::Arc;
1010
use alloc::vec::Vec;
11-
use error::Result;
12-
use parser::Component;
11+
use crate::error::Result;
12+
use crate::parser::Component;
1313

1414
pub struct RowData {
1515
pub index: usize,

src/worker/multithreaded.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
//! and allow scaling to more cores.
55
//! However, that would be more complex, so we use this as a starting point.
66
7-
use decoder::MAX_COMPONENTS;
8-
use error::Result;
97
use std::{mem, io, sync::mpsc::{self, Sender}};
8+
use crate::decoder::MAX_COMPONENTS;
9+
use crate::error::Result;
1010
use super::{RowData, Worker};
1111
use super::immediate::ImmediateWorker;
1212

0 commit comments

Comments
 (0)