@@ -53,10 +53,10 @@ pub trait BufRead {
5353 /// use async_std::io::BufReader;
5454 /// use async_std::prelude::*;
5555 ///
56- /// let mut f = BufReader::new(File::open("a.txt").await?);
56+ /// let mut file = BufReader::new(File::open("a.txt").await?);
5757 ///
5858 /// let mut buf = vec![0; 1024];
59- /// let n = f .read_until(b'\n', &mut buf).await?;
59+ /// let n = file .read_until(b'\n', &mut buf).await?;
6060 /// #
6161 /// # Ok(()) }) }
6262 /// ```
@@ -104,10 +104,10 @@ pub trait BufRead {
104104 /// use async_std::io::BufReader;
105105 /// use async_std::prelude::*;
106106 ///
107- /// let mut f = BufReader::new(File::open("a.txt").await?);
107+ /// let mut file = BufReader::new(File::open("a.txt").await?);
108108 ///
109109 /// let mut buf = String::new();
110- /// f .read_line(&mut buf).await?;
110+ /// file .read_line(&mut buf).await?;
111111 /// #
112112 /// # Ok(()) }) }
113113 /// ```
@@ -145,9 +145,8 @@ pub trait BufRead {
145145 /// use async_std::io::BufReader;
146146 /// use async_std::prelude::*;
147147 ///
148- /// let mut f = BufReader::new(File::open("a.txt").await?);
149- ///
150- /// let mut lines = f.lines();
148+ /// let file = File::open("a.txt").await?;
149+ /// let mut lines = BufReader::new(file).lines();
151150 /// let mut count = 0;
152151 ///
153152 /// for line in lines.next().await {
0 commit comments