mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 07:07:07 +03:00
clippy
This commit is contained in:
parent
7802d7b55b
commit
ac4c38d921
@ -42,7 +42,7 @@ impl<'a> Pass for Unroller<'a> {
|
||||
// Reconstructs the AST based off any flattening work that is done.
|
||||
let mut reconstructor = Self::new(st, handler);
|
||||
let program = reconstructor.reconstruct_program(ast.into_repr());
|
||||
handler.last_err()?;
|
||||
handler.last_err().map_err(|e| *e)?;
|
||||
|
||||
Ok((Ast::new(program), reconstructor.symbol_table.take()))
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ impl<'a> Pass for CreateSymbolTable<'a> {
|
||||
fn do_pass((ast, handler): Self::Input) -> Self::Output {
|
||||
let mut visitor = CreateSymbolTable::new(handler);
|
||||
visitor.visit_program(ast.as_repr());
|
||||
handler.last_err()?;
|
||||
handler.last_err().map_err(|e| *e)?;
|
||||
|
||||
Ok(visitor.symbol_table)
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ impl<'a> Pass for TypeChecker<'a> {
|
||||
fn do_pass((ast, handler, st): Self::Input) -> Self::Output {
|
||||
let mut visitor = TypeChecker::new(st, handler);
|
||||
visitor.visit_program(ast.as_repr());
|
||||
handler.last_err()?;
|
||||
handler.last_err().map_err(|e| *e)?;
|
||||
|
||||
Ok(visitor.symbol_table.take())
|
||||
}
|
||||
|
@ -239,9 +239,9 @@ impl Handler {
|
||||
|
||||
/// Gets the last emitted error's exit code if it exists.
|
||||
/// Then exits the program with it if it did exist.
|
||||
pub fn last_err(&self) -> Result<(), LeoError> {
|
||||
pub fn last_err(&self) -> Result<(), Box<LeoError>> {
|
||||
if let Some(code) = self.inner.borrow().last_emited_err_code() {
|
||||
Err(LeoError::LastErrorCode(code))
|
||||
Err(Box::new(LeoError::LastErrorCode(code)))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user