add VariantCount for IType and Value (#12)

This commit is contained in:
Valery Antopol 2021-09-01 13:29:00 +03:00 committed by GitHub
parent 138bbaf8bd
commit f0c93d9423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 6 deletions

13
Cargo.lock generated
View File

@ -28,11 +28,12 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "fluence-it-types"
version = "0.3.0"
version = "0.3.1"
dependencies = [
"it-to-bytes",
"nom",
"serde",
"variant_count",
"wast",
]
@ -253,6 +254,16 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "variant_count"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aae2faf80ac463422992abf4de234731279c058aaf33171ca70277c98406b124"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "version_check"
version = "0.9.3"

View File

@ -1,6 +1,6 @@
[package]
name = "fluence-it-types"
version = "0.3.0"
version = "0.3.1"
description = "Definitions of IValue and IType"
authors = ["Fluence Labs"]
edition = "2018"
@ -18,5 +18,7 @@ serde = { version = "1.0.118", features = ["derive", "rc"]}
nom = { version = "5.1", optional = true }
wast = { version = "8.0", optional = true }
variant_count = "1.1"
[features]
impls = ["nom", "wast"]

View File

@ -4,9 +4,9 @@ use crate::ne_vec::NEVec;
use serde::Deserialize;
use serde::Serialize;
use variant_count::VariantCount;
/// Represents the types supported by WIT.
#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)]
#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize, VariantCount)]
pub enum IType {
/// Boolean.
Boolean,

View File

@ -2,8 +2,10 @@
use crate::ne_vec::NEVec;
use variant_count::VariantCount;
/// A WIT value.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, VariantCount)]
pub enum IValue {
/// Boolean value.
Boolean(bool),

View File

@ -8,7 +8,7 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018"
[dependencies]
fluence-it-types = { path = "../crates/it-types", version = "0.3.0", features = ["impls"] }
fluence-it-types = { path = "../crates/it-types", version = "0.3.1", features = ["impls"] }
it-to-bytes = { path = "../crates/to-bytes", version = "0.1.0" }
it-lilo = { path = "../crates/it-lilo", version = "0.1.0" }