diff --git a/src/error.rs b/src/error.rs index fbcdbfb..ede5f98 100644 --- a/src/error.rs +++ b/src/error.rs @@ -78,7 +78,7 @@ impl Diagnostic for MietteError { #[cfg(test)] pub(crate) mod tests { - use std::error::Error; + use std::{error::Error, io::ErrorKind}; use super::*; @@ -99,9 +99,9 @@ pub(crate) mod tests { #[test] fn io_error() { - let inner_error = io::Error::other("halt and catch fire"); + let inner_error = io::Error::new(ErrorKind::Other, "halt and catch fire"); let outer_error = TestError(inner_error); - let io_error = io::Error::other(outer_error); + let io_error = io::Error::new(ErrorKind::Other, outer_error); let miette_error = MietteError::from(io_error); diff --git a/src/eyreish/into_diagnostic.rs b/src/eyreish/into_diagnostic.rs index f0a6351..1f90c34 100644 --- a/src/eyreish/into_diagnostic.rs +++ b/src/eyreish/into_diagnostic.rs @@ -46,7 +46,7 @@ impl IntoDiagnostic for R #[cfg(test)] mod tests { - use std::io; + use std::io::{self, ErrorKind}; use super::*; @@ -54,7 +54,7 @@ mod tests { #[test] fn diagnostic_error() { - let inner_error = io::Error::other("halt and catch fire"); + let inner_error = io::Error::new(ErrorKind::Other, "halt and catch fire"); let outer_error: Result<(), _> = Err(TestError(inner_error)); let diagnostic_error = outer_error.into_diagnostic().unwrap_err();