From d4b762e505cae666c82207ff2bfcd692f0a1ac78 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 6 Apr 2020 08:13:10 +0200 Subject: [PATCH] doc(interface-types) Update `from_interface_values`'s doc. Using `InterfaceValue::Record` explicitely doesn't change anything since values are flatten, but it's better for a usual reading to avoid confusion. --- src/interpreter/wasm/serde/de.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/interpreter/wasm/serde/de.rs b/src/interpreter/wasm/serde/de.rs index dba8e8f..49e166e 100644 --- a/src/interpreter/wasm/serde/de.rs +++ b/src/interpreter/wasm/serde/de.rs @@ -36,11 +36,11 @@ use std::{ /// y: f32, /// }; /// -/// let values = vec![ +/// let values = vec![InterfaceValue::Record(vec![ /// InterfaceValue::String("abc".to_string()), /// InterfaceValue::Record(vec![InterfaceValue::I32(1), InterfaceValue::I64(2)]), /// InterfaceValue::F32(3.), -/// ]; +/// ])]; /// let t = from_interface_values::(&values).unwrap(); /// /// assert_eq!( @@ -513,7 +513,7 @@ mod tests { #[derive(Deserialize, Debug, PartialEq)] struct S(i8); - let input = vec![InterfaceValue::S8(42)]; + let input = vec![InterfaceValue::Record(vec![InterfaceValue::S8(42)])]; let output = S(42); assert_eq!(from_interface_values::(&input).unwrap(), output);