Skip to content

Commit

Permalink
Compat with Rust 1.41
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 20, 2021
1 parent 55e8571 commit ae51891
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 65 deletions.
83 changes: 22 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "AGPL-3.0+"
name = "gifski"
readme = "README.md"
repository = "https://github.com/ImageOptim/gifski"
version = "1.4.2"
version = "1.4.3"
autobins = false
edition = "2018"

Expand All @@ -27,7 +27,7 @@ imagequant = "3.0.4-alpha.2"
imgref = "1.8.0"
lodepng = "3.4.5"
pbr = "1.0.4"
resize = "0.7.0"
resize = "0.7.2"
rgb = "0.8.25"
wild = "2.0.4"
natord = "1.0.9"
Expand Down
3 changes: 2 additions & 1 deletion src/bin/gifski.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn bin_main() -> BinResult<()> {
fast: matches.is_present("fast"),
repeat,
};
let quiet = matches.is_present("quiet") || matches!(output_path, DestPath::Stdout);
let quiet = matches.is_present("quiet") || output_path == DestPath::Stdout;
let fps: f32 = matches.value_of("fps").ok_or("Missing fps")?.parse().map_err(|_| "FPS must be a number")?;
let speed: f32 = matches.value_of("fast-forward").ok_or("Missing speed")?.parse().map_err(|_| "Speed must be a number")?;

Expand Down Expand Up @@ -228,6 +228,7 @@ fn parse_opt<T: ::std::str::FromStr<Err = ::std::num::ParseIntError>>(s: Option<
}
}

#[derive(PartialEq)]
enum DestPath<'a> {
Path(&'a Path),
Stdout,
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ impl Writer {
}

// Check that palette is fine and has no duplicate transparent indices
debug_assert!(matches!(image8_pal.len(), 1..=256));
debug_assert!(image8_pal.iter().enumerate().all(|(idx, color)| {
Some(idx as u8) == transparent_index || color.a > 128 || !image8.pixels().any(|px| px == idx as u8)
}));
Expand Down

0 comments on commit ae51891

Please sign in to comment.