Skip to content

Commit

Permalink
fmt: cleanup clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
slbsh committed Aug 1, 2024
1 parent a3f8c3d commit 7e81d60
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl Args {
out.verbs.push(Box::leak(arg.into_boxed_str()) as &str);

// drain remaining args
while let Some(arg) = args.next() {
for arg in args.by_ref() {
out.verbs.push(Box::leak(arg.into_boxed_str()) as &str);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt::{Display, Formatter};

pub struct Program {
pub filename: &'static str,
pub stmts: Vec<Box<AST>>,
pub stmts: Vec<AST>,
}

#[derive(Debug)]
Expand All @@ -23,7 +23,7 @@ pub enum ASTKind {
StringLiteral(String),
CharLiteral(char),

Block(Vec<Box<AST>>),
Block(Vec<AST>),

TypeAnnotation(Type, Option<Box<AST>>),

Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<'t, 'contents> Parser<'t, 'contents> {
}

fn parse_block(&mut self, global: bool) -> Result<AST> {
let mut stmts = Vec::<Box<AST>>::new();
let mut stmts: Vec<AST> = Vec::new();
let until = if global { TokenKind::EOF } else { TokenKind::RBrace };
let start = self.current.span.clone();

Expand Down
6 changes: 2 additions & 4 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ impl Display for ReportFormatter<'_> {
note.bright_black().italic()
)?;
}
} else {
if let Some(note) = &report.note {
writeln!(f, " {}", note.bright_black().italic())?;
}
} else if let Some(note) = &report.note {
writeln!(f, " {}", note.bright_black().italic())?;
}
},
None => {
Expand Down

0 comments on commit 7e81d60

Please sign in to comment.