diff --git a/.travis.yml b/.travis.yml index 682b7737..bd1a2cb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: env: TARGET=x86_64-apple-darwin cache: cargo - os: linux - rust: 1.24.0 + rust: 1.27.0 env: TARGET=x86_64-unknown-linux-gnu cache: cargo - os: linux diff --git a/Cargo.toml b/Cargo.toml index f9d08543..1107725f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,6 @@ optional = true version = "1.0.1" [dependencies.cloudflare-zlib-sys] -optional = true version = "^0.1.2" [dependencies.image] @@ -63,11 +62,10 @@ binary = [ ] default = ["binary", "parallel"] parallel = ["rayon"] -cfzlib = ["cloudflare-zlib-sys"] dev = [ "nightly-binary", ] -nightly = ["cfzlib"] +nightly = [] nightly-binary = [ "binary", "nightly", diff --git a/README.md b/README.md index 58f38949..0d9d3755 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ cargo build --release cp target/release/oxipng /usr/local/bin ``` -The current minimum supported Rust version is **1.24.0**. Oxipng may compile on earlier versions of Rust, +The current minimum supported Rust version is **1.27.0**. Oxipng may compile on earlier versions of Rust, but there is no guarantee. Oxipng follows Semantic Versioning. diff --git a/README.template.md b/README.template.md index 9f5e020e..f7f3a1f4 100644 --- a/README.template.md +++ b/README.template.md @@ -26,7 +26,7 @@ cargo build --release cp target/release/oxipng /usr/local/bin ``` -The current minimum supported Rust version is **1.24.0**. Oxipng may compile on earlier versions of Rust, +The current minimum supported Rust version is **1.27.0**. Oxipng may compile on earlier versions of Rust, but there is no guarantee. Oxipng follows Semantic Versioning. diff --git a/src/deflate/mod.rs b/src/deflate/mod.rs index b8541555..01f31b7a 100644 --- a/src/deflate/mod.rs +++ b/src/deflate/mod.rs @@ -15,17 +15,13 @@ pub fn inflate(data: &[u8]) -> Result, PngError> { /// Compress a data stream using the DEFLATE algorithm pub fn deflate(data: &[u8], zc: u8, zs: u8, zw: u8, max_size: &AtomicMin) -> Result, PngError> { - #[cfg(feature = "cfzlib")] - { - if is_cfzlib_supported() { - return cfzlib_deflate(data, zc, zs, zw, max_size) - } + if is_cfzlib_supported() { + return cfzlib_deflate(data, zc, zs, zw, max_size) } miniz_stream::compress_to_vec_oxipng(data, zc, zw.into(), zs.into(), max_size) } -#[cfg(feature = "cfzlib")] fn is_cfzlib_supported() -> bool { #[cfg(target_arch = "x86_64")] { if is_x86_feature_detected!("sse4.2") && is_x86_feature_detected!("pclmulqdq") { @@ -40,7 +36,6 @@ fn is_cfzlib_supported() -> bool { false } -#[cfg(feature = "cfzlib")] pub fn cfzlib_deflate(data: &[u8], level: u8, strategy: u8, window_bits: u8, max_size: &AtomicMin) -> Result, PngError> { use std::mem; use cloudflare_zlib_sys::*; diff --git a/src/lib.rs b/src/lib.rs index 1edff34b..d8063e50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,6 @@ extern crate num_cpus; #[cfg(feature = "parallel")] extern crate rayon; extern crate zopfli; -#[cfg(feature = "cfzlib")] extern crate cloudflare_zlib_sys; use image::{DynamicImage, GenericImage, ImageFormat, Pixel}; diff --git a/src/main.rs b/src/main.rs index 01c43dd0..deb05d29 100644 --- a/src/main.rs +++ b/src/main.rs @@ -275,7 +275,6 @@ fn collect_files(files: Vec, out_dir: &Option, out_file: &OutF in_out_pairs } -#[cfg_attr(feature = "clippy", allow(cyclomatic_complexity))] fn parse_opts_into_struct(matches: &ArgMatches) -> Result<(OutFile, Option, Options), String> { let mut opts = if let Some(x) = matches.value_of("optimization") { if let Ok(opt) = x.parse::() {