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.
This commit is contained in:
Ivan Enderlin 2020-04-06 08:13:10 +02:00
parent 1f814a445a
commit d4b762e505

View File

@ -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::<T>(&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::<S>(&input).unwrap(), output);