Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Support multi-doc deserialization #189

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Support multi-doc deserialization #189

merged 1 commit into from
Feb 2, 2021

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Feb 2, 2021

use anyhow::Result;
use serde::Deserialize;
use serde_yaml::Value;

fn main() -> Result<()> {
    let input = "---\nk: 107\n...\n---\nj: 106\n";

    for document in serde_yaml::Deserializer::from_str(input) {
        let value = Value::deserialize(document)?;
        println!("{:?}", value);
    }

    Ok(())
}

Closes #175.

@dtolnay dtolnay merged commit cfe758b into master Feb 2, 2021
@dtolnay dtolnay deleted the multide branch February 2, 2021 05:16
Repository owner locked and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow deserializing of documents
1 participant