Skip to content

Commit bb26dc7

Browse files
authored
Merge pull request #275 from linkmauve/edition-2021
Bump to edition 2021
2 parents c17977d + c523d94 commit bb26dc7

File tree

8 files changed

+6
-11
lines changed

8 files changed

+6
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[package]
22
name = "jpeg-decoder"
33
version = "0.3.0"
4-
edition = "2018"
5-
resolver = "2"
4+
edition = "2021"
65

76
rust-version = "1.61.0"
87

fuzz-afl/src/reproduce_decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ fn main() {
1212
let data = utils::read_file_from_args();
1313
match decode(&data) {
1414
Ok(bytes) => println!("Decoded {} bytes", bytes.len()),
15-
Err(e) => println!("Decoder returned an error: {:?}\nNote: Not a panic, this is fine.", e),
15+
Err(e) => println!("Decoder returned an error: {e:?}\nNote: Not a panic, this is fine."),
1616
};
1717
}

src/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use alloc::{format, vec};
1616
use core::cmp;
1717
use core::mem;
1818
use core::ops::Range;
19-
use std::convert::TryInto;
2019
use std::io::Read;
2120

2221
pub const MAX_COMPONENTS: usize = 4;

src/idct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![allow(clippy::erasing_op)]
1010
#![allow(clippy::identity_op)]
1111
use crate::parser::Dimensions;
12-
use core::{convert::TryFrom, num::Wrapping};
12+
use core::num::Wrapping;
1313

1414
pub(crate) fn choose_idct_size(full_size: Dimensions, requested_size: Dimensions) -> usize {
1515
fn scaled(len: u16, scale: usize) -> u16 {
@@ -234,7 +234,7 @@ pub(crate) fn dequantize_and_idct_block(
234234
output_linestride,
235235
output,
236236
),
237-
_ => panic!("Unsupported IDCT scale {}/8", scale),
237+
_ => panic!("Unsupported IDCT scale {scale}/8"),
238238
}
239239
}
240240

src/worker/immediate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use alloc::vec;
22
use alloc::vec::Vec;
33
use core::mem;
4-
use core::convert::TryInto;
54
use crate::decoder::MAX_COMPONENTS;
65
use crate::error::Result;
76
use crate::idct::dequantize_and_idct_block;

src/worker/rayon.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use core::convert::TryInto;
2-
31
use rayon::iter::{IndexedParallelIterator, ParallelIterator};
42
use rayon::slice::ParallelSliceMut;
53

tests/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn test_files(test_dir: &Path) -> Vec<PathBuf> {
2828
let path = test_dir.join(Path::new(&line));
2929

3030
if !test_files.contains(&path) {
31-
panic!("The file {:?} specified in {:?} could not be found among the files being tested", line, test_dir.join("disabled.txt"));
31+
panic!("The file {line:?} specified in {:?} could not be found among the files being tested", test_dir.join("disabled.txt"));
3232
}
3333

3434
let position = test_files.iter().position(|p| p == &path).unwrap();

tests/reftest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn reftest_decoder<T: std::io::Read>(mut decoder: jpeg::Decoder<T>, path: &Path,
116116
encoder.set_color(ref_pixel_format);
117117
encoder.write_header().expect("png failed to write header").write_image_data(&pixels).expect("png failed to write data");
118118

119-
panic!("decoding difference: {:?}, maximum difference was {}", output_path, max_diff);
119+
panic!("decoding difference: {output_path:?}, maximum difference was {max_diff}");
120120
}
121121
}
122122

0 commit comments

Comments
 (0)