Skip to content

Commit

Permalink
feat: show clear compiler error when no backend is chosen. (rust-lang…
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 5, 2023
1 parent 2684a56 commit fbf727d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ mod c;
#[cfg(feature = "any_zlib")]
pub use self::c::*;

#[cfg(not(feature = "any_zlib"))]
#[cfg(all(not(feature = "any_zlib"), feature = "miniz_oxide"))]
mod rust;
#[cfg(not(feature = "any_zlib"))]
#[cfg(all(not(feature = "any_zlib"), feature = "miniz_oxide"))]
pub use self::rust::*;

impl std::fmt::Debug for ErrorMessage {
Expand Down
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@
#![cfg_attr(test, deny(warnings))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

#[cfg(not(any(
feature = "rust_backend",
feature = "zlib",
feature = "zlib-default",
feature = "zlib-ng",
feature = "zlib-ng-compat",
feature = "cloudflare_zlib"
)))]
compile_error!(
"You need to choose a zlib backend"
);

pub use crate::crc::{Crc, CrcReader, CrcWriter};
pub use crate::gz::GzBuilder;
pub use crate::gz::GzHeader;
Expand Down

0 comments on commit fbf727d

Please sign in to comment.