Skip to content

Commit

Permalink
rustup 1.63 -> 1.64; clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tdp2110 committed Oct 11, 2022
1 parent bf621b7 commit 6d2e832
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/bytecode_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ impl Interpreter {
return Ok(());
}

if let Err(err) = self.step() {
return Err(err);
}
self.step()?;
}
}

Expand Down
8 changes: 3 additions & 5 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::expr;
use crate::scanner;
use crate::extensions;
use crate::scanner;

use std::fmt;

Expand Down Expand Up @@ -852,12 +852,10 @@ impl Parser {
}
if self.matches(scanner::TokenType::LeftParen) {
let expr = Box::new(self.expression()?);
if let Err(err) = self.consume(
self.consume(
scanner::TokenType::RightParen,
"Expected ')' after expression.",
) {
return Err(err);
}
)?;
return Ok(expr::Expr::Grouping(expr));
}
if self.extensions.lists && self.matches(scanner::TokenType::LeftBracket) {
Expand Down
12 changes: 3 additions & 9 deletions src/treewalk_interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,7 @@ impl Interpreter {
expr::Expr::Assign(sym, val_expr) => {
let val = self.interpret_expr(val_expr)?;

if let Err(err) = self.env.assign(sym.clone(), &val) {
return Err(err);
}
self.env.assign(sym.clone(), &val)?;

Ok(val)
}
Expand Down Expand Up @@ -1267,9 +1265,9 @@ impl Interpreter {

#[cfg(test)]
mod tests {
use crate::extensions;
use crate::parser;
use crate::scanner;
use crate::extensions;
use crate::treewalk_interpreter;

fn evaluate(code: &str, options: extensions::Extensions) -> Result<String, String> {
Expand Down Expand Up @@ -1335,11 +1333,7 @@ mod tests {
}

fn check_output_default(code: &str, expected_output: &str) {
check_output(
code,
expected_output,
extensions::Extensions::default(),
)
check_output(code, expected_output, extensions::Extensions::default())
}

fn check_error(code: &str, f: &dyn Fn(&str) -> ()) {
Expand Down

0 comments on commit 6d2e832

Please sign in to comment.