Browse Source

Fix warnings

github-actions
Garrit Franke 2 years ago
parent
commit
2a6003846d
  1. 6
      src/generator/x86.rs
  2. 3
      src/parser/node_type.rs

6
src/generator/x86.rs

@ -35,12 +35,6 @@ impl Assembly {
self.asm.push(string.into())
}
fn add_all<S: Into<String>>(&mut self, strings: Vec<S>) {
for string in strings {
self.asm.push(string.into())
}
}
fn build(&self) -> String {
self.asm.join("\n")
}

3
src/parser/node_type.rs

@ -69,7 +69,7 @@ impl TryFrom<Token> for Expression {
.map_err(|_| "Int value could not be parsed")?,
)),
TokenKind::Literal(Value::Str) => Ok(Expression::Str(token.raw)),
other => panic!("Value could not be parsed"),
_ => panic!("Value could not be parsed"),
}
}
}
@ -106,7 +106,6 @@ impl TryFrom<TokenKind> for BinOp {
TokenKind::LessThanOrEqual => Ok(BinOp::LessThanOrEqual),
TokenKind::GreaterThanOrEqual => Ok(BinOp::GreaterThanOrEqual),
TokenKind::NotEqual => Ok(BinOp::NotEqual),
TokenKind::Percent => Ok(BinOp::Modulus),
TokenKind::And => Ok(BinOp::And),
TokenKind::Or => Ok(BinOp::Or),
other => Err(format!("Token {:?} cannot be converted into a BinOp", other).into()),

Loading…
Cancel
Save