specialize Bytes
on StdinLock<'_>
by using the underlying BufReader
This commit is contained in:
parent
bf2637f4e8
commit
1b9a01340b
1 changed files with 10 additions and 1 deletions
|
@ -8,7 +8,9 @@ use crate::io::prelude::*;
|
|||
use crate::cell::{Cell, RefCell};
|
||||
use crate::fmt;
|
||||
use crate::fs::File;
|
||||
use crate::io::{self, BorrowedCursor, BufReader, IoSlice, IoSliceMut, LineWriter, Lines};
|
||||
use crate::io::{
|
||||
self, BorrowedCursor, BufReader, IoSlice, IoSliceMut, LineWriter, Lines, SpecReadByte,
|
||||
};
|
||||
use crate::sync::atomic::{AtomicBool, Ordering};
|
||||
use crate::sync::{Arc, Mutex, MutexGuard, OnceLock, ReentrantMutex, ReentrantMutexGuard};
|
||||
use crate::sys::stdio;
|
||||
|
@ -483,6 +485,13 @@ impl Read for StdinLock<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl SpecReadByte for StdinLock<'_> {
|
||||
#[inline]
|
||||
fn spec_read_byte(&mut self) -> Option<io::Result<u8>> {
|
||||
BufReader::spec_read_byte(&mut *self.inner)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl BufRead for StdinLock<'_> {
|
||||
fn fill_buf(&mut self) -> io::Result<&[u8]> {
|
||||
|
|
Loading…
Add table
Reference in a new issue