-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add support for deserializing enums in config files #8454
Conversation
r? @Eh2406 (rust_highfive has picked a reviewer for you, use r? to override) |
r? @ehuss |
Could this perhaps try to deserialize all enums as strings? I'm not really sure how we'd represent something like |
@alexcrichton I'd love to, but I'm not very good with serde. That's why there's some
Does that mean I should call |
61d924b
to
65fc4ce
Compare
@ehuss I've applied your suggestions, and also added a test to ensure the code graciously fails on an invalid enum variant. |
Looks great, thanks! |
📌 Commit 65fc4ce has been approved by |
☀️ Test successful - checks-azure |
Update cargo 5 commits in fede83ccf973457de319ba6fa0e36ead454d2e20..729e5676a02404b1d745013f8b280945cfa2d50d 2020-07-02 21:51:34 +0000 to 2020-07-07 15:51:28 +0000 - Add support for deserializing enums in config files (rust-lang/cargo#8454) - Write GNU tar files, supporting long names. (rust-lang/cargo#8453) - Don't overwrite existing `rustdoc` args with --document-private-items (rust-lang/cargo#8449) - Add some help about rustup's +toolchain syntax. (rust-lang/cargo#8455) - Update metadata man page. (rust-lang/cargo#8451)
Update cargo 6 commits in fede83ccf973457de319ba6fa0e36ead454d2e20..4f74d9b2a771c58b7ef4906b2668afd075bc8081 2020-07-02 21:51:34 +0000 to 2020-07-08 17:13:00 +0000 - Disable long_file_names test if not supported on Windows. (rust-lang/cargo#8469) - Add support for deserializing enums in config files (rust-lang/cargo#8454) - Write GNU tar files, supporting long names. (rust-lang/cargo#8453) - Don't overwrite existing `rustdoc` args with --document-private-items (rust-lang/cargo#8449) - Add some help about rustup's +toolchain syntax. (rust-lang/cargo#8455) - Update metadata man page. (rust-lang/cargo#8451)
Update cargo 6 commits in fede83ccf973457de319ba6fa0e36ead454d2e20..4f74d9b2a771c58b7ef4906b2668afd075bc8081 2020-07-02 21:51:34 +0000 to 2020-07-08 17:13:00 +0000 - Disable long_file_names test if not supported on Windows. (rust-lang/cargo#8469) - Add support for deserializing enums in config files (rust-lang/cargo#8454) - Write GNU tar files, supporting long names. (rust-lang/cargo#8453) - Don't overwrite existing `rustdoc` args with --document-private-items (rust-lang/cargo#8449) - Add some help about rustup's +toolchain syntax. (rust-lang/cargo#8455) - Update metadata man page. (rust-lang/cargo#8451)
Update cargo 6 commits in fede83ccf973457de319ba6fa0e36ead454d2e20..4f74d9b2a771c58b7ef4906b2668afd075bc8081 2020-07-02 21:51:34 +0000 to 2020-07-08 17:13:00 +0000 - Disable long_file_names test if not supported on Windows. (rust-lang/cargo#8469) - Add support for deserializing enums in config files (rust-lang/cargo#8454) - Write GNU tar files, supporting long names. (rust-lang/cargo#8453) - Don't overwrite existing `rustdoc` args with --document-private-items (rust-lang/cargo#8449) - Add some help about rustup's +toolchain syntax. (rust-lang/cargo#8455) - Update metadata man page. (rust-lang/cargo#8451)
Implements
deserialize_enum
functionality to allow config options which are Rust enums.@ehuss The code currently has some
todo!
s because I'm not sure how the customDeserializer
is supposed to do error handling.Fixes #8450