Skip to content

Commit

Permalink
fix(core): Don't use autofcg for alloc
Browse files Browse the repository at this point in the history
Requires at least rust 1.36, though crate now depends on 1.40 or newer due to use of non_exhaustive

Closes #106
  • Loading branch information
oyvindln committed Nov 1, 2021
1 parent 2e9408a commit a9bf654
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 24 deletions.
4 changes: 0 additions & 4 deletions miniz_oxide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ documentation = "https://docs.rs/miniz_oxide"
description = "DEFLATE compression and decompression library rewritten in Rust based on miniz"
edition = "2018"
exclude = ["benches/*", "tests/*"]
build = "build.rs"

[lib]
name = "miniz_oxide"

[build-dependencies]
autocfg = "1.0"

[dependencies]
adler = { version = "1.0", default-features = false }
simd-adler32 = { version = "0.3", default-features = false, optional = true }
Expand Down
6 changes: 0 additions & 6 deletions miniz_oxide/build.rs

This file was deleted.

3 changes: 1 addition & 2 deletions miniz_oxide/src/deflate/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2357,8 +2357,7 @@ mod test {
MZ_DEFAULT_WINDOW_BITS,
};
use crate::inflate::decompress_to_vec;
use std::prelude::v1::*;
use std::vec;
use alloc::vec;

#[test]
fn u16_to_slice() {
Expand Down
2 changes: 1 addition & 1 deletion miniz_oxide/src/deflate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fn compress_to_vec_inner(input: &[u8], level: u8, window_bits: i32, strategy: i3
mod test {
use super::{compress_to_vec, compress_to_vec_inner, CompressionStrategy};
use crate::inflate::decompress_to_vec;
use std::vec;
use alloc::vec;

/// Test deflate example.
///
Expand Down
4 changes: 2 additions & 2 deletions miniz_oxide/src/deflate/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ mod test {
use crate::deflate::CompressorOxide;
use crate::inflate::decompress_to_vec_zlib;
use crate::{MZFlush, MZStatus};
use std::prelude::v1::*;
use std::vec;
use alloc::vec;
use alloc::boxed::Box;

#[test]
fn test_state() {
Expand Down
2 changes: 1 addition & 1 deletion miniz_oxide/src/inflate/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ fn push_dict_out(state: &mut InflateState, next_out: &mut &mut [u8]) -> usize {
mod test {
use super::{inflate, InflateState};
use crate::{DataFormat, MZFlush, MZStatus};
use std::vec;
use alloc::vec;

#[test]
fn test_state() {
Expand Down
9 changes: 1 addition & 8 deletions miniz_oxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,9 @@

#![allow(warnings)]
#![forbid(unsafe_code)]
#![cfg_attr(any(has_alloc, feature = "rustc-dep-of-std"), no_std)]
#![no_std]

// autocfg does not work when building in libstd, so manually enable this for that use case now.
#[cfg(any(has_alloc, feature = "rustc-dep-of-std"))]
extern crate alloc;
#[cfg(all(not(has_alloc), not(feature = "rustc-dep-of-std")))]
use std as alloc;

#[cfg(test)]
extern crate std;

pub mod deflate;
pub mod inflate;
Expand Down

0 comments on commit a9bf654

Please sign in to comment.