mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 07:10:21 +00:00
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:
parent
1f814a445a
commit
d4b762e505
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user