Skip to content

Commit 7381944

Browse files
committed
Auto merge of #13193 - alex-semenyuk:fix_doc_unused_io_amount, r=xFrednet
Fix doc example for UNUSED_IO_AMOUNT Cosmetic changes. Unify example for UNUSED_IO_AMOUNT changelog: none
2 parents 70457f6 + 8bf5a83 commit 7381944

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clippy_lints/src/unused_io_amount.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,18 @@ declare_clippy_lint! {
3434
/// ```rust,ignore
3535
/// use std::io;
3636
/// fn foo<W: io::Write>(w: &mut W) -> io::Result<()> {
37-
/// // must be `w.write_all(b"foo")?;`
3837
/// w.write(b"foo")?;
3938
/// Ok(())
4039
/// }
4140
/// ```
41+
/// Use instead:
42+
/// ```rust,ignore
43+
/// use std::io;
44+
/// fn foo<W: io::Write>(w: &mut W) -> io::Result<()> {
45+
/// w.write_all(b"foo")?;
46+
/// Ok(())
47+
/// }
48+
/// ```
4249
#[clippy::version = "pre 1.29.0"]
4350
pub UNUSED_IO_AMOUNT,
4451
correctness,

0 commit comments

Comments
 (0)