diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /vendor/miniz_oxide/src/lib.rs | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.tar.xz rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/miniz_oxide/src/lib.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/miniz_oxide/src/lib.rs b/vendor/miniz_oxide/src/lib.rs index 8357c5200..fd64932b0 100644 --- a/vendor/miniz_oxide/src/lib.rs +++ b/vendor/miniz_oxide/src/lib.rs @@ -22,10 +22,12 @@ //! ``` #![forbid(unsafe_code)] -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] +#[cfg(feature = "with-alloc")] extern crate alloc; +#[cfg(feature = "with-alloc")] pub mod deflate; pub mod inflate; mod shared; @@ -154,7 +156,7 @@ pub enum DataFormat { } impl DataFormat { - pub(crate) fn from_window_bits(window_bits: i32) -> DataFormat { + pub fn from_window_bits(window_bits: i32) -> DataFormat { if window_bits > 0 { DataFormat::Zlib } else { @@ -162,7 +164,7 @@ impl DataFormat { } } - pub(crate) fn to_window_bits(self) -> i32 { + pub fn to_window_bits(self) -> i32 { match self { DataFormat::Zlib | DataFormat::ZLibIgnoreChecksum => shared::MZ_DEFAULT_WINDOW_BITS, DataFormat::Raw => -shared::MZ_DEFAULT_WINDOW_BITS, @@ -186,7 +188,7 @@ pub struct StreamResult { impl StreamResult { #[inline] - pub(crate) const fn error(error: MZError) -> StreamResult { + pub const fn error(error: MZError) -> StreamResult { StreamResult { bytes_consumed: 0, bytes_written: 0, |