Improvements to github workflow (#4)

- format check
- clippy checks
- build tests separately before running

Also fix clippy warnings

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2023-02-10 11:16:09 +05:30
committed by GitHub
parent dc0720b32a
commit c92707433e
9 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -941,7 +941,7 @@ impl<'source> Interpreter<'source> {
Value::Set(s) if !s.is_empty() => Err(span.source.error(
span.line,
span.col,
format!("function produced multiple outputs {:?}", value).as_str(),
format!("function produced multiple outputs {value:?}").as_str(),
)),
// If the function successfully executed, but did not return any value, then return true.
Value::Set(s) if s.is_empty() && output_expr.is_none() => Ok(Value::Bool(true)),
@@ -1040,7 +1040,7 @@ impl<'source> Interpreter<'source> {
Err(e) => Err(span.source.error(
span.line,
span.col,
format!("could not parse number. {}", e).as_str(),
format!("could not parse number. {e}").as_str(),
)),
},
// TODO: Handle string vs rawstring
+1 -1
View File
@@ -21,7 +21,7 @@ impl<'source> Source<'source> {
return format!("{}: invalid line {} specified", self.file, line);
}
let line_str = format!("{}", line);
let line_str = format!("{line}");
let line_num_width = line_str.len() + 1;
let col_spaces = col as usize - 1;
+2 -2
View File
@@ -46,7 +46,7 @@ impl<'source> Parser<'source> {
if self.tok.1.text() == text {
self.next_token()
} else {
let msg = format!("expecting `{}` {}", text, context);
let msg = format!("expecting `{text}` {context}");
Err(self.source.error(self.tok.1.line, self.tok.1.col, &msg))
}
}
@@ -801,7 +801,7 @@ impl<'source> Parser<'source> {
return Err(self.source.error(
span.line,
span.col,
format!("Failed to parse `every` statement.\n{}", e).as_str(),
format!("Failed to parse `every` statement.\n{e}").as_str(),
))
}
}
+1 -1
View File
@@ -137,7 +137,7 @@ impl Serialize for Value {
impl fmt::Display for Value {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Ok(s) => write!(f, "{s}"),
Err(_e) => Err(std::fmt::Error),
}
}