diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/flate2/src/gz | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/flate2/src/gz')
-rw-r--r-- | vendor/flate2/src/gz/bufread.rs | 16 | ||||
-rw-r--r-- | vendor/flate2/src/gz/mod.rs | 9 | ||||
-rw-r--r-- | vendor/flate2/src/gz/read.rs | 14 |
3 files changed, 23 insertions, 16 deletions
diff --git a/vendor/flate2/src/gz/bufread.rs b/vendor/flate2/src/gz/bufread.rs index 6fc48bcdd..679b4a7de 100644 --- a/vendor/flate2/src/gz/bufread.rs +++ b/vendor/flate2/src/gz/bufread.rs @@ -19,10 +19,10 @@ fn copy(into: &mut [u8], from: &[u8], pos: &mut usize) -> usize { /// A gzip streaming encoder /// -/// This structure exposes a [`BufRead`] interface that will read uncompressed data -/// from the underlying reader and expose the compressed version as a [`BufRead`] -/// interface. +/// This structure implements a [`Read`] interface. When read from, it reads +/// uncompressed data from the underlying [`BufRead`] and provides the compressed data. /// +/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html /// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html /// /// # Examples @@ -165,8 +165,8 @@ impl<R: BufRead + Write> Write for GzEncoder<R> { /// A decoder for a single member of a [gzip file]. /// -/// This structure exposes a [`BufRead`] interface, reading compressed data -/// from the underlying reader, and emitting uncompressed data. +/// This structure implements a [`Read`] interface. When read from, it reads +/// compressed data from the underlying [`BufRead`] and provides the uncompressed data. /// /// After reading a single member of the gzip data this reader will return /// Ok(0) even if there are more bytes available in the underlying reader. @@ -178,6 +178,7 @@ impl<R: BufRead + Write> Write for GzEncoder<R> { /// [in the introduction](../index.html#about-multi-member-gzip-files). /// /// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5 +/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html /// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html /// /// # Examples @@ -351,8 +352,8 @@ impl<R: BufRead + Write> Write for GzDecoder<R> { /// A gzip streaming decoder that decodes a [gzip file] that may have multiple members. /// -/// This structure exposes a [`BufRead`] interface that will consume compressed -/// data from the underlying reader and emit uncompressed data. +/// This structure implements a [`Read`] interface. When read from, it reads +/// compressed data from the underlying [`BufRead`] and provides the uncompressed data. /// /// A gzip file consists of a series of *members* concatenated one after another. /// MultiGzDecoder decodes all members from the data and only returns Ok(0) when the @@ -362,6 +363,7 @@ impl<R: BufRead + Write> Write for GzDecoder<R> { /// [in the introduction](../index.html#about-multi-member-gzip-files). /// /// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5 +/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html /// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html /// /// # Examples diff --git a/vendor/flate2/src/gz/mod.rs b/vendor/flate2/src/gz/mod.rs index e8e05c6eb..31a696116 100644 --- a/vendor/flate2/src/gz/mod.rs +++ b/vendor/flate2/src/gz/mod.rs @@ -87,7 +87,7 @@ impl GzHeader { } } -#[derive(Debug, Default)] +#[derive(Debug)] pub enum GzHeaderState { Start(u8, [u8; 10]), Xlen(Option<Box<Crc>>, u8, [u8; 2]), @@ -95,10 +95,15 @@ pub enum GzHeaderState { Filename(Option<Box<Crc>>), Comment(Option<Box<Crc>>), Crc(Option<Box<Crc>>, u8, [u8; 2]), - #[default] Complete, } +impl Default for GzHeaderState { + fn default() -> Self { + Self::Complete + } +} + #[derive(Debug, Default)] pub struct GzHeaderParser { state: GzHeaderState, diff --git a/vendor/flate2/src/gz/read.rs b/vendor/flate2/src/gz/read.rs index 5a65526ce..9dbadbda7 100644 --- a/vendor/flate2/src/gz/read.rs +++ b/vendor/flate2/src/gz/read.rs @@ -8,9 +8,8 @@ use crate::Compression; /// A gzip streaming encoder /// -/// This structure exposes a [`Read`] interface that will read uncompressed data -/// from the underlying reader and expose the compressed version as a [`Read`] -/// interface. +/// This structure implements a [`Read`] interface. When read from, it reads +/// uncompressed data from the underlying [`Read`] and provides the compressed data. /// /// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html /// @@ -92,8 +91,8 @@ impl<R: Read + Write> Write for GzEncoder<R> { /// A decoder for a single member of a [gzip file]. /// -/// This structure exposes a [`Read`] interface that will consume compressed -/// data from the underlying reader and emit uncompressed data. +/// This structure implements a [`Read`] interface. When read from, it reads +/// compressed data from the underlying [`Read`] and provides the uncompressed data. /// /// After reading a single member of the gzip data this reader will return /// Ok(0) even if there are more bytes available in the underlying reader. @@ -201,8 +200,9 @@ impl<R: Read + Write> Write for GzDecoder<R> { /// A gzip streaming decoder that decodes a [gzip file] that may have multiple members. /// -/// This structure exposes a [`Read`] interface that will consume compressed -/// data from the underlying reader and emit uncompressed data. +/// This structure implements a [`Read`] interface. When read from, it reads +/// compressed data from the underlying [`Read`] and provides the uncompressed +/// data. /// /// A gzip file consists of a series of *members* concatenated one after another. /// MultiGzDecoder decodes all members of a file and returns Ok(0) once the |