Skip to content

Commit

Permalink
Add panic document for stdio::stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVeryDarkness committed Dec 24, 2024
1 parent 848c34b commit 1097536
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ pub(crate) static STDIN: LazyLock<Mutex<InputStream<BufReader<Stdin>>>> =
/// Get an exclusive handle to the standard input stream.
///
/// See [io::stdin] and [io::Stdin::lock] for more information.
///
/// # Panics
///
/// This function will panic if the standard input stream is already locked by current thread,
/// or if the standard input stream is poisoned.
#[inline]
pub fn stdin() -> MutexGuard<'static, InputStream<BufReader<Stdin>>> {
STDIN.lock().unwrap()
Expand Down

0 comments on commit 1097536

Please sign in to comment.