mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-25 11:12:48 +03:00
clippy
This commit is contained in:
parent
914a9c385e
commit
0368b8bd51
@ -173,10 +173,7 @@ pub trait StatementVisitor<'a>: ExpressionVisitor<'a> {
|
||||
/// A Visitor trait for the program represented by the AST.
|
||||
pub trait ProgramVisitor<'a>: StatementVisitor<'a> {
|
||||
fn visit_program(&mut self, input: &'a Program) {
|
||||
input
|
||||
.imports
|
||||
.values()
|
||||
.for_each(|import| self.visit_import(import));
|
||||
input.imports.values().for_each(|import| self.visit_import(import));
|
||||
|
||||
input
|
||||
.functions
|
||||
|
@ -43,7 +43,7 @@ pub struct Program {
|
||||
|
||||
impl fmt::Display for Program {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
for(_, import) in self.imports.iter() {
|
||||
for (_, import) in self.imports.iter() {
|
||||
import.fmt(f)?;
|
||||
writeln!(f,)?;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ impl ParserContext<'_> {
|
||||
let leo_file_extension = self.expect_identifier()?;
|
||||
|
||||
if leo_file_extension.name.ne(&sym::leo) {
|
||||
return Err(ParserError::leo_imports_only(leo_file_extension, self.token.span).into())
|
||||
return Err(ParserError::leo_imports_only(leo_file_extension, self.token.span).into());
|
||||
}
|
||||
let end = self.expect(&Token::Semicolon)?;
|
||||
|
||||
|
@ -42,7 +42,8 @@ impl<'a> CodeGenerator<'a> {
|
||||
}
|
||||
|
||||
// Print the program id.
|
||||
writeln!(program_string, "program {}.{};", input.name, input.network).expect("Failed to write program id to string.");
|
||||
writeln!(program_string, "program {}.{};", input.name, input.network)
|
||||
.expect("Failed to write program id to string.");
|
||||
|
||||
// Newline separator.
|
||||
program_string.push('\n');
|
||||
|
Loading…
Reference in New Issue
Block a user