Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot distinguish between foo: and foo: ~ #36

Closed
not-my-profile opened this issue Sep 8, 2024 · 0 comments · Fixed by #37
Closed

Cannot distinguish between foo: and foo: ~ #36

not-my-profile opened this issue Sep 8, 2024 · 0 comments · Fixed by #37

Comments

@not-my-profile
Copy link

I'd like to deserialize foo: as an empty mapping/sequence and treat foo: ~/foo: null as an error.

Unfortunately this isn't currently possible with yaml-rust2 because it emits a non-existing ~ Scalar event:

% cargo run --bin dump_events <(echo 'foo:')
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/dump_events /proc/self/fd/11`
      ↳ StreamStart
      ↳ DocumentStart
      ↳ MappingStart(0, None)
      ↳ Scalar("foo", Plain, 0, None)
      ↳ Scalar("~", Plain, 0, None)
      ↳ MappingEnd
      ↳ DocumentEnd
      ↳ StreamEnd
not-my-profile added a commit to not-my-profile/yaml-rust2 that referenced this issue Sep 8, 2024
not-my-profile added a commit to not-my-profile/yaml-rust2 that referenced this issue Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant