Skip to content

Commit

Permalink
Make clear that most streams out there will typically not need MultiG…
Browse files Browse the repository at this point in the history
…zDecoders

Make perfectly clear when to use which type.

Co-Authored-By: Josh Triplett <[email protected]>
  • Loading branch information
Byron and joshtriplett committed Jul 21, 2023
1 parent a232574 commit cfa8214
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/gz/bufread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ impl<R: BufRead + Write> Write for GzDecoder<R> {
///
/// A gzip file consists of a series of "members" concatenated one after another.
/// MultiGzDecoder decodes all members of a file, while [GzDecoder] will only decode
/// the first member. MultiGzDecoder is preferable in most cases.
/// the first member. Many gzip files in the wild will typically have one member,
/// but not all. Use MultiGzDecoder if you need to handle multiple members, or
/// [GzDecoder] if you know you only need to handle a single member.
///
/// This structure exposes a [`BufRead`] interface that will consume all gzip members
/// from the underlying reader and emit uncompressed data.
Expand Down
6 changes: 4 additions & 2 deletions src/gz/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ impl<R: Read + Write> Write for GzDecoder<R> {
///
/// A gzip file consists of a series of "members" concatenated one after another.
/// MultiGzDecoder decodes all members of a file, while [GzDecoder] will only decode
/// the first member. MultiGzDecoder is preferable in most cases.
///
/// the first member. Many gzip files in the wild will typically have one member,
/// but not all. Use MultiGzDecoder if you need to handle multiple members, or
/// [GzDecoder] if you know you only need to handle a single member.

/// This structure exposes a [`Read`] interface that will consume all gzip members
/// from the underlying reader and emit uncompressed data.
///
Expand Down
4 changes: 3 additions & 1 deletion src/gz/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ impl<W: Read + Write> Read for GzDecoder<W> {
///
/// A gzip file consists of a series of "members" concatenated one after another.
/// MultiGzDecoder decodes all members of a file, while [GzDecoder] will only decode
/// the first member. MultiGzDecoder is preferable in most cases.
/// the first member. Many gzip files in the wild will typically have one member,
/// but not all. Use MultiGzDecoder if you need to handle multiple members, or
/// [GzDecoder] if you know you only need to handle a single member.
///
/// This structure exposes a [`Write`] interface that will consume all gzip members
/// from the written buffers and write uncompressed data to the writer.
Expand Down

0 comments on commit cfa8214

Please sign in to comment.