Skip to content

Commit 3a7fd1a

Browse files
committed
Implement From for FromBytesWithNulError
Signed-off-by: Alex Saveau <[email protected]>
1 parent bb1a03c commit 3a7fd1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/error.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,14 @@ impl Error for core::ffi::FromBytesWithNulError {
637637
}
638638
}
639639

640+
#[unstable(feature = "todo", issue = "none")]
641+
impl From<core::ffi::FromBytesWithNulError> for io::Error {
642+
/// Converts a [`NulError`] into an [`io::Error`].
643+
fn from(e: core::ffi::FromBytesWithNulError) -> io::Error {
644+
io::Error::new(io::ErrorKind::InvalidInput, e)
645+
}
646+
}
647+
640648
#[unstable(feature = "cstr_from_bytes_until_nul", issue = "95027")]
641649
impl Error for core::ffi::FromBytesUntilNulError {}
642650

0 commit comments

Comments
 (0)