The idiom for iterating over documents in a single input is:
let de = serde_yaml::Deserializer::from_str(…);
for document in de {
let t = T::deserialize(document)?;
…
}
It's confusing to assign semantics to the following however, since YAML only has one level of documents; documents cannot be nested inside of other documents.
let de = serde_yaml::Deserializer::from_str(…);
for document in de {
for nested in document {
let t = T::deserialize(nested)?;
}
}
Previously this would do something confusing based on whether a T had been deserialized from document directly already or not. After this PR, document will always appear empty when iterated.
The idiom for iterating over documents in a single input is:
It's confusing to assign semantics to the following however, since YAML only has one level of documents; documents cannot be nested inside of other documents.
Previously this would do something confusing based on whether a
T
had been deserialized fromdocument
directly already or not. After this PR,document
will always appear empty when iterated.