Merge pull request #231 from alexcrichton/hash

Enable using `Type` in a `HashMap`
This commit is contained in:
Sergey Pepyakin 2018-10-28 18:25:36 +01:00 committed by GitHub
commit 6e43ba42e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ use super::{
}; };
/// Type definition in types section. Currently can be only of the function type. /// Type definition in types section. Currently can be only of the function type.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Hash, Eq)]
pub enum Type { pub enum Type {
/// Function type. /// Function type.
Function(FunctionType), Function(FunctionType),
@ -32,7 +32,7 @@ impl Serialize for Type {
} }
/// Value type. /// Value type.
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq, Hash, Eq)]
pub enum ValueType { pub enum ValueType {
/// 32-bit signed integer /// 32-bit signed integer
I32, I32,
@ -136,7 +136,7 @@ impl Serialize for BlockType {
} }
/// Function signature type. /// Function signature type.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Hash, Eq)]
pub struct FunctionType { pub struct FunctionType {
form: u8, form: u8,
params: Vec<ValueType>, params: Vec<ValueType>,