Run all the linters

This commit is contained in:
bad 2022-04-03 22:07:19 +02:00
parent 74770a7a31
commit ef765220a2
4 changed files with 10 additions and 9 deletions

View File

@ -29,7 +29,7 @@ impl<'a> From<&'a OwnedLocation> for Location<'a> {
Location {
line: l.line,
col: l.col,
file: l.file.as_ref().map(|v| v.as_str()),
file: l.file.as_deref(),
}
}
}

View File

@ -1,4 +1,3 @@
use crate::error::{ErrorWithLocation, Location, OwnedLocation};
use core::fmt;
use std::error::Error;

View File

@ -39,19 +39,19 @@ mod run {
Error::ASTParsing(_) => "ast generation",
Error::Runtime(_) => "runtime",
};
write!(f, "Errors occured during {error_kind}\n")?;
writeln!(f, "Errors occured during {error_kind}")?;
match *self {
Error::Lexing(ref errors) => {
for error in errors {
write!(f, "{error} \n")?;
writeln!(f, "{error} ")?;
}
}
Error::ASTParsing(ref errors) => {
for error in errors {
write!(f, "{error} \n")?;
writeln!(f, "{error} ")?;
}
}
Error::Runtime(ref error) => write!(f, "{error} \n")?,
Error::Runtime(ref error) => writeln!(f, "{error} ")?,
};
Ok(())

View File

@ -1,5 +1,5 @@
use crftng_intrprtrs::run;
use crftng_intrprtrs::interpreter::types;
use crftng_intrprtrs::run;
#[test]
fn test_one_equality() {
@ -12,6 +12,8 @@ fn test_one_equality() {
}
fn run_check_result_eq_bool(code: &str, value: bool) {
assert_eq!(run(code).unwrap(), types::Value::Primitive(types::Primitive::Bool(value)))
assert_eq!(
run(code).unwrap(),
types::Value::Primitive(types::Primitive::Bool(value))
)
}