Thanks to visit codestin.com
Credit goes to github.com

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

Deserialize empty file to struct containing no required fields #86

@forbjok

Description

@forbjok

... even though there are no non-optional fields in the struct.
Or any fields at all, for that matter.

Attempting to deserialize an empty file (or a file containing only newlines) produces the following error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: EndOfStream', /checkout/src/libcore/result.rs:916:4

IMO deserializing an empty file should succeed as long as there are no required fields in the struct.

(I'm using serde_yaml 0.7.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions