Skip to content

Commit

Permalink
Simplify doc-tests
Browse files Browse the repository at this point in the history
Now that `read_to_end` is used, the amount of returned bytes is neatly
encoded in the buffer's length.
  • Loading branch information
Byron committed Jul 17, 2023
1 parent 3281693 commit 08f7d73
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/deflate/read.rs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ use crate::bufreader::BufReader;
/// let mut ret_vec = Vec::new();
/// let c = b"hello world";
/// let mut deflater = DeflateEncoder::new(&c[..], Compression::fast());
/// let count = deflater.read_to_end(&mut ret_vec)?;
/// deflater.read_to_end(&mut ret_vec)?;
/// Ok(ret_vec)
/// }
/// ```
2 changes: 1 addition & 1 deletion src/gz/read.rs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ use crate::Compression;
/// let mut ret_vec = Vec::new();
/// let bytestring = b"hello world";
/// let mut gz = GzEncoder::new(&bytestring[..], Compression::fast());
/// let count = gz.read_to_end(&mut ret_vec)?;
/// gz.read_to_end(&mut ret_vec)?;
/// Ok(ret_vec)
/// }
/// ```
2 changes: 1 addition & 1 deletion src/zlib/read.rs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ use crate::bufreader::BufReader;
/// let f = File::open("examples/hello_world.txt")?;
/// let mut z = ZlibEncoder::new(f, Compression::fast());
/// let mut buffer = Vec::new();
/// let byte_count = z.read_to_end(&mut buffer)?;
/// z.read_to_end(&mut buffer)?;
/// # Ok(buffer)
/// # }
/// ```

0 comments on commit 08f7d73

Please sign in to comment.