Relax implicit R: Sized bound on BufReader<R>

This commit is contained in:
Maybe Waffle 2023-05-01 17:17:05 +00:00
parent b7d8c88b64
commit e77b14e2ac
3 changed files with 17 additions and 14 deletions

View file

@ -466,7 +466,7 @@ impl<T: CopyRead> CopyRead for Take<T> {
}
}
impl<T: CopyRead> CopyRead for BufReader<T> {
impl<T: ?Sized + CopyRead> CopyRead for BufReader<T> {
fn drain_to<W: Write>(&mut self, writer: &mut W, outer_limit: u64) -> Result<u64> {
let buf = self.buffer();
let buf = &buf[0..min(buf.len(), outer_limit.try_into().unwrap_or(usize::MAX))];