chore: remove useless Hash impl
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
use std::hash::Hash;
|
|
||||||
|
|
||||||
use ecow::EcoString;
|
use ecow::EcoString;
|
||||||
|
|
||||||
use crate::ty::internal::{Const, Param};
|
use crate::ty::internal::{Const, Param};
|
||||||
@@ -94,7 +92,7 @@ pub enum OpCode {
|
|||||||
NoOp,
|
NoOp,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Hash)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum BinOp {
|
pub enum BinOp {
|
||||||
Add,
|
Add,
|
||||||
And,
|
And,
|
||||||
@@ -104,7 +102,7 @@ pub enum BinOp {
|
|||||||
Upd,
|
Upd,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Hash)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum UnOp {
|
pub enum UnOp {
|
||||||
Not,
|
Not,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,16 +107,3 @@ impl PartialEq for Const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Eq 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),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ pub trait ToPublic {
|
|||||||
fn to_public(self, vm: &VM) -> p::Value;
|
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);
|
pub struct Thunk(usize);
|
||||||
|
|
||||||
#[derive(Debug, IsVariant, Unwrap, Clone, PartialEq)]
|
#[derive(Debug, IsVariant, Unwrap, Clone, PartialEq)]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::hash::{Hash, Hasher};
|
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
use derive_more::{IsVariant, Unwrap};
|
use derive_more::{IsVariant, Unwrap};
|
||||||
use ecow::EcoString;
|
use ecow::EcoString;
|
||||||
@@ -121,16 +119,3 @@ impl PartialEq for Const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Eq 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),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user