mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 03:54:00 +00:00
Rework enums in rust. (#6098)
* Rework enums in rust. They're now a unit struct, rather than an enum. This is a backwards incompatible change but the previous version had UB and was also backwards incompatible so... * Update and test sample rust flatbuffers * Use bitflags crate to properly support rust enums. Previously, the bitflags attribute was just ignored. This is a breaking change as the bitflgs API is not like a normal rust enum (duh). * variant_name() -> Option<_> * repr transparent * Reexport bitflags from flatbuffers * Make bitflags constants CamelCase, matching normal enums * Deprecate c-style associated enum constants Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -32,6 +32,11 @@ path = "../../samples/sample_flexbuffers.rs"
|
||||
name = "sample_flexbuffers_serde"
|
||||
path = "../../samples/sample_flexbuffers_serde.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "sample_flatbuffers"
|
||||
path = "../../samples/sample_binary.rs"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "0.6"
|
||||
# TODO(rw): look into moving to criterion.rs
|
||||
|
||||
Reference in New Issue
Block a user