]> git.lizzy.rs Git - rust.git/commitdiff
Impl `io::error::repr_unpacked::Repr::new`
authorJiahao XU <Jiahao_XU@outlook.com>
Wed, 22 Jun 2022 12:01:21 +0000 (22:01 +1000)
committerJiahao XU <Jiahao_XU@outlook.com>
Wed, 22 Jun 2022 12:01:21 +0000 (22:01 +1000)
that accepts `ErrorData<Box<Custom>>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
library/std/src/io/error/repr_unpacked.rs

index 3729c039c42d70553482fe6a74511d60017547c1..d6ad55b99f5c0aef5abe2d413084b1e2a84d0033 100644 (file)
 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))
     }