]> git.lizzy.rs Git - rust.git/blob - tests/ui/unused_io_amount.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / unused_io_amount.rs
1 #![allow(dead_code)]
2 #![warn(clippy::unused_io_amount)]
3
4 use std::io;
5
6 fn question_mark<T: io::Read + io::Write>(s: &mut T) -> io::Result<()> {
7     s.write(b"test")?;
8     let mut buf = [0u8; 4];
9     s.read(&mut buf)?;
10     Ok(())
11 }
12
13 fn unwrap<T: io::Read + io::Write>(s: &mut T) {
14     s.write(b"test").unwrap();
15     let mut buf = [0u8; 4];
16     s.read(&mut buf).unwrap();
17 }
18
19 fn main() {}