misc: apply clippy lints
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user