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

Enum deserialization broken with 0.9 but worked with 0.8 #342

Closed
razvan opened this issue Nov 15, 2022 · 3 comments
Closed

Enum deserialization broken with 0.9 but worked with 0.8 #342

razvan opened this issue Nov 15, 2022 · 3 comments

Comments

@razvan
Copy link

razvan commented Nov 15, 2022

Hello,

the title says everything.

I've put together the smallest example I could come up with here which is a stripped down version of this.

Am I doing something wrong ?

Thanks.

Update: here is the error message.

$ cargo run
   Compiling serde_yaml_issue v0.1.0 (/home/ubuntu/repo/ubuntu/serde_yaml_issue)
    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
     Running `target/debug/serde_yaml_issue`
thread 'main' panicked at 'well...this sucks: Error("deepStorage: invalid type: map, expected a YAML tag starting with '!'", line: 3, column: 7)', src/main.rs:41:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@dtolnay
Copy link
Owner

dtolnay commented Nov 15, 2022

The enum representation is one of the differences from 0.8 to 0.9. Refer to https://github.com/dtolnay/serde-yaml/releases/tag/0.9.0. You can serialize a value to see how it's represented.

@dtolnay dtolnay closed this as completed Nov 15, 2022
@blake-mealey
Copy link

Is there any way to get the old behaviour with 0.9 or should I stick to 0.8 for that syntax? I find config files more readable with the old way.

@dtolnay
Copy link
Owner

dtolnay commented Nov 20, 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

No branches or pull requests

3 participants