misc: apply clippy lints

This commit is contained in:
2025-06-19 15:51:23 +01:00
parent c1d72e8d4c
commit 81433dcbcd
17 changed files with 134 additions and 127 deletions
+9 -3
View File
@@ -12,7 +12,6 @@ pub struct Node {
}
#[macro_export]
#[macro_use]
macro_rules! node {
($symbol: expr, $opcode: expr, args: $tokens: expr) => {
Node::new($symbol.clone(), $opcode.clone(), $tokens.clone())
@@ -55,7 +54,7 @@ impl Node {
impl fmt::Display for Node {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let symbol = match &self.label() {
Some(symbol) => format!("{}:\n", symbol),
Some(symbol) => format!("{symbol}:\n"),
None => "".to_string(),
};
@@ -146,12 +145,19 @@ impl fmt::Display for Opcode {
}
}
#[derive(Debug, Clone, Eq, Hash)]
#[derive(Debug, Clone, Eq)]
pub struct Symbol {
pub name: String,
pub module: Module,
}
impl std::hash::Hash for Symbol {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.name.hash(state);
self.module.hash(state);
}
}
impl PartialEq for Symbol {
fn eq(&self, other: &Self) -> bool {
self.name == other.name && self.module == other.module