Keep consistency in example for Stdin StdinLock

Stdin uses handle whereas StdinLock uses stdin_lock, changed it to handle.
This commit is contained in:
Ivan Tham 2021-02-18 10:11:57 +08:00 committed by GitHub
parent 93f6a4b9d8
commit 026be9dc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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(())
/// }