Skip to content

Commit

Permalink
modify description
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaroning committed Jun 7, 2022
1 parent 1776977 commit 34b42f4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions clippy_lints/src/read_zero_byte_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ declare_clippy_lint! {
///
/// ### Example
/// ```rust
/// let mut data = Vec::with_capacity(len);
/// r.read_exact(&mut data)?;
/// use std::io;
/// fn foo<F: io::Read>(mut f: F) {
/// let mut data = Vec::with_capacity(100);
/// f.read(&mut data).unwrap();
/// }
/// ```
/// Use instead:
/// ```rust
/// let mut data = Vec::with_capacity(len);
/// data.resize(len, 0);
/// r.read_exact(&mut data)?;
/// use std::io;
/// fn foo<F: io::Read>(mut f: F) {
/// let mut data = Vec::with_capacity(100);
/// data.resize(100, 0);
/// f.read(&mut data).unwrap();
/// }
/// ```
#[clippy::version = "1.63.0"]
pub READ_ZERO_BYTE_VEC,
Expand Down

0 comments on commit 34b42f4

Please sign in to comment.