1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::{
io::Error,
num::{ParseFloatError, ParseIntError},
};
use diagnostic::DiagnosticLevel;
use crate::{IOError, VosError, VosErrorKind};
pub mod io_error;
impl From<ParseIntError> for VosError {
fn from(error: ParseIntError) -> Self {
let e = error.to_string();
Self { kind: Box::new(VosErrorKind::ParseError(e)), level: DiagnosticLevel::Error }
}
}
impl From<ParseFloatError> for VosError {
fn from(error: ParseFloatError) -> Self {
let e = error.to_string();
Self { kind: Box::new(VosErrorKind::ParseError(e)), level: DiagnosticLevel::Error }
}
}