voml_error/error/
for_std.rs

1use super::*;
2
3impl From<std::io::Error> for VomlError {
4    fn from(e: std::io::Error) -> Self {
5        Self { kind: Box::new(VomlErrorKind::IOError(e)), level: DiagnosticLevel::Error, file: Default::default() }
6    }
7}
8// impl From<std::fmt::Error> for VomlError {
9//     fn from(e: std::fmt::Error) -> Self {
10//         Self { kind: Box::new(VomlErrorKind::FormatError(e)), level: DiagnosticLevel::None, file: None, range: None }
11//     }
12// }
13
14impl From<Infallible> for VomlError {
15    fn from(_: Infallible) -> Self {
16        Self { kind: Box::new(VomlErrorKind::UnknownError), level: DiagnosticLevel::Error, file: Default::default() }
17    }
18}
19
20impl From<()> for VomlError {
21    fn from(_: ()) -> Self {
22        Self { kind: Box::new(VomlErrorKind::UnknownError), level: DiagnosticLevel::Error, file: Default::default() }
23    }
24}