diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:50 +0000 |
commit | 2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch) | |
tree | d325add32978dbdc1db975a438b3a77d571b1ab8 /vendor/miniz_oxide/src/lib.rs | |
parent | Releasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/miniz_oxide/src/lib.rs')
-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, |