@@ -216,12 +216,12 @@ fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
216
216
/// # Examples
217
217
///
218
218
/// ```no_run
219
- /// use std::io::{self, Read} ;
219
+ /// use std::io;
220
220
///
221
221
/// fn main() -> io::Result<()> {
222
222
/// let mut buffer = String::new();
223
223
/// let mut stdin = io::stdin(); // We get `Stdin` here.
224
- /// stdin.read_to_string (&mut buffer)?;
224
+ /// stdin.read_line (&mut buffer)?;
225
225
/// Ok(())
226
226
/// }
227
227
/// ```
@@ -244,14 +244,14 @@ pub struct Stdin {
244
244
/// # Examples
245
245
///
246
246
/// ```no_run
247
- /// use std::io::{self, Read };
247
+ /// use std::io::{self, BufRead };
248
248
///
249
249
/// fn main() -> io::Result<()> {
250
250
/// let mut buffer = String::new();
251
251
/// let stdin = io::stdin(); // We get `Stdin` here.
252
252
/// {
253
253
/// let mut handle = stdin.lock(); // We get `StdinLock` here.
254
- /// handle.read_to_string (&mut buffer)?;
254
+ /// handle.read_line (&mut buffer)?;
255
255
/// } // `StdinLock` is dropped here.
256
256
/// Ok(())
257
257
/// }
@@ -277,26 +277,26 @@ pub struct StdinLock<'a> {
277
277
/// Using implicit synchronization:
278
278
///
279
279
/// ```no_run
280
- /// use std::io::{self, Read} ;
280
+ /// use std::io;
281
281
///
282
282
/// fn main() -> io::Result<()> {
283
283
/// let mut buffer = String::new();
284
- /// io::stdin().read_to_string (&mut buffer)?;
284
+ /// io::stdin().read_line (&mut buffer)?;
285
285
/// Ok(())
286
286
/// }
287
287
/// ```
288
288
///
289
289
/// Using explicit synchronization:
290
290
///
291
291
/// ```no_run
292
- /// use std::io::{self, Read };
292
+ /// use std::io::{self, BufRead };
293
293
///
294
294
/// fn main() -> io::Result<()> {
295
295
/// let mut buffer = String::new();
296
296
/// let stdin = io::stdin();
297
297
/// let mut handle = stdin.lock();
298
298
///
299
- /// handle.read_to_string (&mut buffer)?;
299
+ /// handle.read_line (&mut buffer)?;
300
300
/// Ok(())
301
301
/// }
302
302
/// ```
@@ -337,13 +337,13 @@ pub fn stdin() -> Stdin {
337
337
///
338
338
/// ```no_run
339
339
/// #![feature(stdio_locked)]
340
- /// use std::io::{self, Read };
340
+ /// use std::io::{self, BufRead };
341
341
///
342
342
/// fn main() -> io::Result<()> {
343
343
/// let mut buffer = String::new();
344
344
/// let mut handle = io::stdin_locked();
345
345
///
346
- /// handle.read_to_string (&mut buffer)?;
346
+ /// handle.read_line (&mut buffer)?;
347
347
/// Ok(())
348
348
/// }
349
349
/// ```
@@ -363,14 +363,14 @@ impl Stdin {
363
363
/// # Examples
364
364
///
365
365
/// ```no_run
366
- /// use std::io::{self, Read };
366
+ /// use std::io::{self, BufRead };
367
367
///
368
368
/// fn main() -> io::Result<()> {
369
369
/// let mut buffer = String::new();
370
370
/// let stdin = io::stdin();
371
371
/// let mut handle = stdin.lock();
372
372
///
373
- /// handle.read_to_string (&mut buffer)?;
373
+ /// handle.read_line (&mut buffer)?;
374
374
/// Ok(())
375
375
/// }
376
376
/// ```
@@ -432,13 +432,13 @@ impl Stdin {
432
432
///
433
433
/// ```no_run
434
434
/// #![feature(stdio_locked)]
435
- /// use std::io::{self, Read };
435
+ /// use std::io::{self, BufRead };
436
436
///
437
437
/// fn main() -> io::Result<()> {
438
438
/// let mut buffer = String::new();
439
439
/// let mut handle = io::stdin().into_locked();
440
440
///
441
- /// handle.read_to_string (&mut buffer)?;
441
+ /// handle.read_line (&mut buffer)?;
442
442
/// Ok(())
443
443
/// }
444
444
/// ```
0 commit comments