mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-26 11:45:00 +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.
|
/// A Visitor trait for the program represented by the AST.
|
||||||
pub trait ProgramVisitor<'a>: StatementVisitor<'a> {
|
pub trait ProgramVisitor<'a>: StatementVisitor<'a> {
|
||||||
fn visit_program(&mut self, input: &'a Program) {
|
fn visit_program(&mut self, input: &'a Program) {
|
||||||
input
|
input.imports.values().for_each(|import| self.visit_import(import));
|
||||||
.imports
|
|
||||||
.values()
|
|
||||||
.for_each(|import| self.visit_import(import));
|
|
||||||
|
|
||||||
input
|
input
|
||||||
.functions
|
.functions
|
||||||
|
@ -43,7 +43,7 @@ pub struct Program {
|
|||||||
|
|
||||||
impl fmt::Display for Program {
|
impl fmt::Display for Program {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
for(_, import) in self.imports.iter() {
|
for (_, import) in self.imports.iter() {
|
||||||
import.fmt(f)?;
|
import.fmt(f)?;
|
||||||
writeln!(f,)?;
|
writeln!(f,)?;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ impl ParserContext<'_> {
|
|||||||
let leo_file_extension = self.expect_identifier()?;
|
let leo_file_extension = self.expect_identifier()?;
|
||||||
|
|
||||||
if leo_file_extension.name.ne(&sym::leo) {
|
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)?;
|
let end = self.expect(&Token::Semicolon)?;
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@ impl<'a> CodeGenerator<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print the program id.
|
// 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.
|
// Newline separator.
|
||||||
program_string.push('\n');
|
program_string.push('\n');
|
||||||
|
Loading…
Reference in New Issue
Block a user