mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-02 18:11:34 +00:00
feat(interface-types) Add the Vec1
type to represent a non-empty vector.
`Vec1` is used by `RecordType` to ensure that a record have at least 1 field. Then an `InterfaceValue::Record` is ensured to get at least one value with the type-checking pass.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use wasmer_interface_types::{
|
||||
ast::*, decoders::binary::parse, encoders::binary::ToBytes, interpreter::Instruction,
|
||||
vec1::Vec1,
|
||||
};
|
||||
|
||||
/// Tests an AST to binary, then binary to AST roundtrip.
|
||||
@ -16,7 +17,7 @@ fn test_binary_encoding_decoding_roundtrip() {
|
||||
outputs: vec![InterfaceType::S32],
|
||||
},
|
||||
Type::Record(RecordType {
|
||||
fields: vec![InterfaceType::String, InterfaceType::I32],
|
||||
fields: Vec1::new(vec![InterfaceType::String, InterfaceType::I32]).unwrap(),
|
||||
}),
|
||||
],
|
||||
imports: vec![Import {
|
||||
|
Reference in New Issue
Block a user