mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
buf: impl Error for CollectVecError (#1010)
This commit is contained in:
parent
ea7178b8c6
commit
cb91dd274a
@ -2,6 +2,8 @@ use SizeHint;
|
||||
|
||||
use bytes::{Buf, BufMut, Bytes};
|
||||
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
use std::usize;
|
||||
|
||||
/// Conversion from a `BufStream`.
|
||||
@ -134,3 +136,27 @@ impl<T: Buf> FromBufStream<T> for Bytes {
|
||||
Ok(builder.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CollectVecError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(fmt, "BufStream is too big")
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for CollectVecError {
|
||||
fn description(&self) -> &str {
|
||||
"BufStream too big"
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for CollectBytesError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(fmt, "BufStream too big")
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for CollectBytesError {
|
||||
fn description(&self) -> &str {
|
||||
"BufStream too big"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user