Skip to content

Commit 3e2be46

Browse files
authored
Merge pull request #157 from kornelski/msrv
Increase MSRV to 1.60
2 parents 497c3af + f1c939a commit 3e2be46

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
rust: ["1.34.2", stable, beta, nightly]
12+
rust: ["1.60.0", stable, beta, nightly]
1313
features: ["", "std", "color_quant"]
1414
steps:
1515
- uses: actions/checkout@v2
@@ -23,7 +23,7 @@ jobs:
2323
- name: test
2424
run: >
2525
cargo test --tests --benches --no-default-features --features "$FEATURES"
26-
if: ${{ matrix.rust != '1.34.2' }}
26+
if: ${{ matrix.rust != '1.60.0' }}
2727
env:
2828
FEATURES: ${{ matrix.features }}
2929
rustfmt:

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ readme = "README.md"
88
homepage = "https://github.com/image-rs/image-gif"
99
repository = "https://github.com/image-rs/image-gif"
1010
documentation = "https://docs.rs/gif"
11-
edition = "2018"
11+
edition = "2021"
1212
exclude = [
1313
"tests/crashtest/*",
1414
"tests/samples/*",
@@ -31,6 +31,7 @@ png = "0.17.2"
3131
[features]
3232
default = ["raii_no_panic", "std", "color_quant"]
3333
raii_no_panic = []
34+
color_quant = ["dep:color_quant"]
3435
# Reservation for a feature turning off std
3536
std = []
3637

benches/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn main() {
2626
sample_size: usize,
2727
}
2828

29-
fn run_bench_def<M: Measurement>(group: &mut BenchmarkGroup<M>, def: BenchDef) {
29+
fn run_bench_def<M: Measurement>(group: &mut BenchmarkGroup<'_, M>, def: BenchDef) {
3030
group
3131
.sample_size(def.sample_size)
3232
.throughput(Throughput::Bytes(def.data.len() as u64))

src/encoder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub enum EncodingError {
5050
}
5151

5252
impl fmt::Display for EncodingError {
53-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
53+
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
5454
match self {
5555
EncodingError::Io(err) => err.fmt(fmt),
5656
EncodingError::Format(err) => err.fmt(fmt),
@@ -177,12 +177,12 @@ impl<W: Write> Encoder<W> {
177177
/// Writes a frame to the image.
178178
///
179179
/// Note: This function also writes a control extension if necessary.
180-
pub fn write_frame(&mut self, frame: &Frame) -> Result<(), EncodingError> {
180+
pub fn write_frame(&mut self, frame: &Frame<'_>) -> Result<(), EncodingError> {
181181
self.write_frame_header(frame)?;
182182
self.write_image_block(&frame.buffer)
183183
}
184184

185-
fn write_frame_header(&mut self, frame: &Frame) -> Result<(), EncodingError> {
185+
fn write_frame_header(&mut self, frame: &Frame<'_>) -> Result<(), EncodingError> {
186186
// TODO commented off to pass test in lib.rs
187187
//if frame.delay > 0 || frame.transparent.is_some() {
188188
self.write_extension(ExtensionData::new_control_ext(
@@ -321,7 +321,7 @@ impl<W: Write> Encoder<W> {
321321
/// from [`Frame::make_lzw_pre_encoded`].
322322
///
323323
/// Note: This function also writes a control extension if necessary.
324-
pub fn write_lzw_pre_encoded_frame(&mut self, frame: &Frame) -> Result<(), EncodingError> {
324+
pub fn write_lzw_pre_encoded_frame(&mut self, frame: &Frame<'_>) -> Result<(), EncodingError> {
325325
// empty data is allowed
326326
if let Some(&min_code_size) = frame.buffer.get(0) {
327327
if min_code_size > 11 || min_code_size < 2 {

src/reader/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl DecodingError {
6868

6969
impl fmt::Display for DecodingError {
7070
#[cold]
71-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
71+
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
7272
match *self {
7373
DecodingError::Format(ref d) => d.fmt(fmt),
7474
DecodingError::Io(ref err) => err.fmt(fmt),
@@ -350,7 +350,7 @@ impl StreamingDecoder {
350350
// the match (e.g. `return Ok(self.next_state(buf)?)`). If
351351
// it compiles the returned lifetime is correct.
352352
unsafe {
353-
mem::transmute::<Decoded, Decoded>(result)
353+
mem::transmute::<Decoded<'_>, Decoded<'a>>(result)
354354
}
355355
))
356356
}

src/reader/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ struct ReadDecoder<R: Read> {
174174
}
175175

176176
impl<R: Read> ReadDecoder<R> {
177-
fn decode_next(&mut self, mut decode_bytes_into: Option<&mut [u8]>) -> Result<Option<Decoded>, DecodingError> {
177+
fn decode_next(&mut self, mut decode_bytes_into: Option<&mut [u8]>) -> Result<Option<Decoded<'_>>, DecodingError> {
178178
while !self.at_eof {
179179
let (consumed, result) = {
180180
let buf = self.reader.fill_buf()?;
@@ -193,7 +193,7 @@ impl<R: Read> ReadDecoder<R> {
193193
},
194194
result => return Ok(unsafe{
195195
// FIXME: #6393
196-
Some(mem::transmute::<Decoded, Decoded>(result))
196+
Some(mem::transmute::<Decoded<'_>, Decoded<'_>>(result))
197197
}),
198198
}
199199
}

tests/check_testimages.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate gif;
2-
extern crate glob;
31

42
use std::collections::HashMap;
53
use std::fs::File;

tests/roundtrip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn encode_roundtrip() {
88

99
fn round_trip_from_image(original: &[u8]) {
1010
let (width, height, global_palette);
11-
let frames: Vec<Frame> = {
11+
let frames: Vec<_> = {
1212
let mut decoder = Decoder::new(original).unwrap();
1313
width = decoder.width();
1414
height = decoder.height();

0 commit comments

Comments
 (0)