Rust Object API (#6070)

* inital commit of rust object api

* Required fields support.

* clang fallthrough

* Fix unused variables

* just don't fall through

* remove comment

* s/panic/unreachable

* Tests for object API

* Added defaults

* deleted unintentionally added files and updated .bat file

* fix bat file

* clang format

* Cargo clippy checks

* remove commented out code

* clippy allows

* Remove matches! macro since we're not yet at Rust v1.42

* install clippy in RustTest.sh

* move line

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-01-22 13:07:32 -05:00
committed by GitHub
parent 796ed68faf
commit 1da0a2dfac
21 changed files with 2362 additions and 319 deletions

View File

@@ -19,6 +19,7 @@ extern crate flatbuffers;
// import the generated code
#[path = "./monster_generated.rs"]
#[allow(clippy::approx_constant)] // We use low precision PI as a default value.
mod monster_generated;
pub use monster_generated::my_game::sample::{Color, Equipment,
Monster, MonsterArgs,
@@ -27,7 +28,7 @@ pub use monster_generated::my_game::sample::{Color, Equipment,
// Example how to use FlatBuffers to create and read binary buffers.
#[allow(clippy::float_cmp)]
fn main() {
// Build up a serialized buffer algorithmically.
// Initialize it with a capacity of 1024 bytes.