From 2a756bd4851e6d5c03169f62c1257b2de3dd7210 Mon Sep 17 00:00:00 2001 From: vms Date: Sun, 13 Sep 2020 23:29:09 +0300 Subject: [PATCH] add Eq, Hash for types; bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/types.rs | 6 +++--- src/vec1.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa41388..b94511e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "wasmer-interface-types-fl" -version = "0.17.3" +version = "0.17.4" dependencies = [ "log", "nom", diff --git a/Cargo.toml b/Cargo.toml index 0b14141..2deb218 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmer-interface-types-fl" -version = "0.17.3" +version = "0.17.4" description = "WebAssembly Interface Types library for Wasmer" license = "MIT" authors = ["The Wasmer Engineering Team "] diff --git a/src/types.rs b/src/types.rs index 6317487..b7706ed 100644 --- a/src/types.rs +++ b/src/types.rs @@ -4,7 +4,7 @@ use crate::vec1::Vec1; use serde::{Deserialize, Serialize}; /// Represents the types supported by WIT. -#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] +#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)] pub enum InterfaceType { /// A 8-bits signed integer. S8, @@ -57,7 +57,7 @@ pub enum InterfaceType { } /// Represents a record field type. -#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)] +#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)] pub struct RecordFieldType { // TODO: make name optional to support structures with anonymous fields in Rust /// A field name. @@ -68,7 +68,7 @@ pub struct RecordFieldType { } /// Represents a record type. -#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] +#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)] pub struct RecordType { /// A record name. pub name: String, diff --git a/src/vec1.rs b/src/vec1.rs index d7d0aa9..360a3e3 100644 --- a/src/vec1.rs +++ b/src/vec1.rs @@ -9,7 +9,7 @@ use std::{ /// `Vec1` represents a non-empty `Vec`. It derefs to `Vec` /// directly. -#[derive(Clone, PartialEq, Serialize, Deserialize, Default)] +#[derive(Clone, PartialEq, Eq, Serialize, Hash, Deserialize, Default)] pub struct Vec1(Vec) where T: Debug;