Skip to content

Commit f62ff42

Browse files
authored
Merge pull request #375 from georeth/fix-read-doc
Fix and unify docs of `bufread` and `read` types.
2 parents f285e9a + 5b23cc9 commit f62ff42

File tree

6 files changed

+36
-30
lines changed

6 files changed

+36
-30
lines changed

src/deflate/bufread.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ use crate::{Compress, Decompress};
77

88
/// A DEFLATE encoder, or compressor.
99
///
10-
/// This structure consumes a [`BufRead`] interface, reading uncompressed data
11-
/// from the underlying reader, and emitting compressed data.
10+
/// This structure implements a [`Read`] interface. When read from, it reads
11+
/// uncompressed data from the underlying [`BufRead`] and provides the compressed data.
1212
///
13+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
1314
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
1415
///
1516
/// # Examples
@@ -123,9 +124,10 @@ impl<W: BufRead + Write> Write for DeflateEncoder<W> {
123124

124125
/// A DEFLATE decoder, or decompressor.
125126
///
126-
/// This structure consumes a [`BufRead`] interface, reading compressed data
127-
/// from the underlying reader, and emitting uncompressed data.
127+
/// This structure implements a [`Read`] interface. When read from, it reads
128+
/// compressed data from the underlying [`BufRead`] and provides the uncompressed data.
128129
///
130+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
129131
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
130132
///
131133
/// # Examples

src/deflate/read.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::bufreader::BufReader;
66

77
/// A DEFLATE encoder, or compressor.
88
///
9-
/// This structure implements a [`Read`] interface and will read uncompressed
10-
/// data from an underlying stream and emit a stream of compressed data.
9+
/// This structure implements a [`Read`] interface. When read from, it reads
10+
/// uncompressed data from the underlying [`Read`] and provides the compressed data.
1111
///
1212
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
1313
///
@@ -120,8 +120,8 @@ impl<W: Read + Write> Write for DeflateEncoder<W> {
120120

121121
/// A DEFLATE decoder, or decompressor.
122122
///
123-
/// This structure implements a [`Read`] interface and takes a stream of
124-
/// compressed data as input, providing the decompressed data when read from.
123+
/// This structure implements a [`Read`] interface. When read from, it reads
124+
/// compressed data from the underlying [`Read`] and provides the uncompressed data.
125125
///
126126
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
127127
///

src/gz/bufread.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ fn copy(into: &mut [u8], from: &[u8], pos: &mut usize) -> usize {
1919

2020
/// A gzip streaming encoder
2121
///
22-
/// This structure exposes a [`BufRead`] interface that will read uncompressed data
23-
/// from the underlying reader and expose the compressed version as a [`BufRead`]
24-
/// interface.
22+
/// This structure implements a [`Read`] interface. When read from, it reads
23+
/// uncompressed data from the underlying [`BufRead`] and provides the compressed data.
2524
///
25+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
2626
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
2727
///
2828
/// # Examples
@@ -165,8 +165,8 @@ impl<R: BufRead + Write> Write for GzEncoder<R> {
165165

166166
/// A decoder for a single member of a [gzip file].
167167
///
168-
/// This structure exposes a [`BufRead`] interface, reading compressed data
169-
/// from the underlying reader, and emitting uncompressed data.
168+
/// This structure implements a [`Read`] interface. When read from, it reads
169+
/// compressed data from the underlying [`BufRead`] and provides the uncompressed data.
170170
///
171171
/// After reading a single member of the gzip data this reader will return
172172
/// 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> {
178178
/// [in the introduction](../index.html#about-multi-member-gzip-files).
179179
///
180180
/// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5
181+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
181182
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
182183
///
183184
/// # Examples
@@ -351,8 +352,8 @@ impl<R: BufRead + Write> Write for GzDecoder<R> {
351352

352353
/// A gzip streaming decoder that decodes a [gzip file] that may have multiple members.
353354
///
354-
/// This structure exposes a [`BufRead`] interface that will consume compressed
355-
/// data from the underlying reader and emit uncompressed data.
355+
/// This structure implements a [`Read`] interface. When read from, it reads
356+
/// compressed data from the underlying [`BufRead`] and provides the uncompressed data.
356357
///
357358
/// A gzip file consists of a series of *members* concatenated one after another.
358359
/// 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> {
362363
/// [in the introduction](../index.html#about-multi-member-gzip-files).
363364
///
364365
/// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5
366+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
365367
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
366368
///
367369
/// # Examples

src/gz/read.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use crate::Compression;
88

99
/// A gzip streaming encoder
1010
///
11-
/// This structure exposes a [`Read`] interface that will read uncompressed data
12-
/// from the underlying reader and expose the compressed version as a [`Read`]
13-
/// interface.
11+
/// This structure implements a [`Read`] interface. When read from, it reads
12+
/// uncompressed data from the underlying [`Read`] and provides the compressed data.
1413
///
1514
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
1615
///
@@ -92,8 +91,8 @@ impl<R: Read + Write> Write for GzEncoder<R> {
9291

9392
/// A decoder for a single member of a [gzip file].
9493
///
95-
/// This structure exposes a [`Read`] interface that will consume compressed
96-
/// data from the underlying reader and emit uncompressed data.
94+
/// This structure implements a [`Read`] interface. When read from, it reads
95+
/// compressed data from the underlying [`Read`] and provides the uncompressed data.
9796
///
9897
/// After reading a single member of the gzip data this reader will return
9998
/// 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> {
201200

202201
/// A gzip streaming decoder that decodes a [gzip file] that may have multiple members.
203202
///
204-
/// This structure exposes a [`Read`] interface that will consume compressed
205-
/// data from the underlying reader and emit uncompressed data.
203+
/// This structure implements a [`Read`] interface. When read from, it reads
204+
/// compressed data from the underlying [`Read`] and provides the uncompressed
205+
/// data.
206206
///
207207
/// A gzip file consists of a series of *members* concatenated one after another.
208208
/// MultiGzDecoder decodes all members of a file and returns Ok(0) once the

src/zlib/bufread.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ use crate::{Compress, Decompress};
77

88
/// A ZLIB encoder, or compressor.
99
///
10-
/// This structure consumes a [`BufRead`] interface, reading uncompressed data
11-
/// from the underlying reader, and emitting compressed data.
10+
/// This structure implements a [`Read`] interface. When read from, it reads
11+
/// uncompressed data from the underlying [`BufRead`] and provides the compressed data.
1212
///
13+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
1314
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
1415
///
1516
/// # Examples
@@ -128,9 +129,10 @@ impl<R: BufRead + Write> Write for ZlibEncoder<R> {
128129

129130
/// A ZLIB decoder, or decompressor.
130131
///
131-
/// This structure consumes a [`BufRead`] interface, reading compressed data
132-
/// from the underlying reader, and emitting uncompressed data.
132+
/// This structure implements a [`Read`] interface. When read from, it reads
133+
/// compressed data from the underlying [`BufRead`] and provides the uncompressed data.
133134
///
135+
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
134136
/// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html
135137
///
136138
/// # Examples

src/zlib/read.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::Decompress;
77

88
/// A ZLIB encoder, or compressor.
99
///
10-
/// This structure implements a [`Read`] interface and will read uncompressed
11-
/// data from an underlying stream and emit a stream of compressed data.
10+
/// This structure implements a [`Read`] interface. When read from, it reads
11+
/// uncompressed data from the underlying [`Read`] and provides the compressed data.
1212
///
1313
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
1414
///
@@ -126,8 +126,8 @@ impl<W: Read + Write> Write for ZlibEncoder<W> {
126126

127127
/// A ZLIB decoder, or decompressor.
128128
///
129-
/// This structure implements a [`Read`] interface and takes a stream of
130-
/// compressed data as input, providing the decompressed data when read from.
129+
/// This structure implements a [`Read`] interface. When read from, it reads
130+
/// compressed data from the underlying [`Read`] and provides the uncompressed data.
131131
///
132132
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
133133
///

0 commit comments

Comments
 (0)