File tree 1 file changed +4
-9
lines changed
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -1579,18 +1579,13 @@ pub trait BufRead: Read {
1579
1579
/// let stdin = io::stdin();
1580
1580
/// let mut stdin = stdin.lock();
1581
1581
///
1582
- /// // we can't have two `&mut` references to `stdin`, so use a block
1583
- /// // to end the borrow early.
1584
- /// let length = {
1585
- /// let buffer = stdin.fill_buf().unwrap();
1582
+ /// let buffer = stdin.fill_buf().unwrap();
1586
1583
///
1587
- /// // work with buffer
1588
- /// println!("{:?}", buffer);
1589
- ///
1590
- /// buffer.len()
1591
- /// };
1584
+ /// // work with buffer
1585
+ /// println!("{:?}", buffer);
1592
1586
///
1593
1587
/// // ensure the bytes we worked with aren't returned again later
1588
+ /// let length = buffer.len();
1594
1589
/// stdin.consume(length);
1595
1590
/// ```
1596
1591
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments