]> git.lizzy.rs Git - rust.git/commit
std: Decode::read_enum_variant should pass in the variant names
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 27 Mar 2013 01:46:48 +0000 (18:46 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 27 Mar 2013 14:04:13 +0000 (07:04 -0700)
commit4d6dcefcbb8688b69dd80bc7382a2f593c3b08d8
tree0c688bb5af8a87ec2566e0d88da9b031e539e625
parent478e4498b76178dc0031f88f0d5ee31c5f804d0b
std: Decode::read_enum_variant should pass in the variant names

Because the json::Decoder uses the string variant name, we need a
way to correlate the string to the enum index. This passes in a
static &[&str] to read_enum_variant, which allows the json::Decoder
to know which branch it's trying to process.
src/librustc/middle/astencode.rs
src/libstd/ebml.rs
src/libstd/json.rs
src/libstd/serialize.rs
src/libsyntax/ext/auto_encode.rs