Impl io::error::repr_unpacked::Repr::new

that accepts `ErrorData<Box<Custom>>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-22 22:01:21 +10:00
parent 89a0783f1c
commit d11ff2a06e
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -10,6 +10,10 @@ type Inner = ErrorData<Box<Custom>>;
pub(super) struct Repr(Inner);
impl Repr {
#[inline]
pub(super) fn new(dat: ErrorData<Box<Custom>>) -> Self {
Self(dat)
}
pub(super) fn new_custom(b: Box<Custom>) -> Self {
Self(Inner::Custom(b))
}