]> git.lizzy.rs Git - rust.git/commitdiff
Keep consistency in example for Stdin StdinLock
authorIvan Tham <pickfire@riseup.net>
Thu, 18 Feb 2021 02:11:57 +0000 (10:11 +0800)
committerGitHub <noreply@github.com>
Thu, 18 Feb 2021 02:11:57 +0000 (10:11 +0800)
Stdin uses handle whereas StdinLock uses stdin_lock, changed it to handle.

library/std/src/io/stdio.rs

index 1160011f352875514d15687f05c3fd75d117292f..80933f6de3d729c72a32a7882f688a3349b64b5c 100644 (file)
@@ -251,8 +251,8 @@ pub struct Stdin {
 ///     let mut buffer = String::new();
 ///     let stdin = io::stdin(); // We get `Stdin` here.
 ///     {
-///         let mut stdin_lock = stdin.lock(); // We get `StdinLock` here.
-///         stdin_lock.read_to_string(&mut buffer)?;
+///         let mut handle = stdin.lock(); // We get `StdinLock` here.
+///         handle.read_to_string(&mut buffer)?;
 ///     } // `StdinLock` is dropped here.
 ///     Ok(())
 /// }