chore: remove useless Hash impl

This commit is contained in:
2025-05-03 20:46:39 +08:00
parent 2f8a530612
commit cc88e7c65f
4 changed files with 3 additions and 33 deletions

View File

@@ -107,16 +107,3 @@ impl PartialEq for Const {
}
impl Eq for Const {}
/* impl Hash for Const {
fn hash<H: Hasher>(&self, state: &mut H) {
use Const::*;
match self {
Bool(b) => b.hash(state),
Int(int) => int.hash(state),
Float(float) => float.to_bits().hash(state),
String(string) => string.hash(state),
Func(func) => func.hash(state),
}
}
} */

View File

@@ -27,7 +27,7 @@ pub trait ToPublic {
fn to_public(self, vm: &VM) -> p::Value;
}
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Constructor)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Constructor)]
pub struct Thunk(usize);
#[derive(Debug, IsVariant, Unwrap, Clone, PartialEq)]

View File

@@ -1,5 +1,3 @@
use std::hash::{Hash, Hasher};
use anyhow::Error;
use derive_more::{IsVariant, Unwrap};
use ecow::EcoString;
@@ -121,16 +119,3 @@ impl PartialEq for Const {
}
impl Eq for Const {}
impl Hash for Const {
fn hash<H: Hasher>(&self, state: &mut H) {
use Const::*;
match self {
Bool(b) => b.hash(state),
Int(int) => int.hash(state),
Float(float) => float.to_bits().hash(state),
String(string) => string.hash(state),
func @ Func => func.hash(state),
}
}
}