Commit 636b5164 authored by csmoe's avatar csmoe Committed by Robert

clean up unnecessary outer rust gen-snippet (#5013)

* clean up unneeded outer rust gen-snippet

* update generated rust file
parent 560718e9
...@@ -294,10 +294,7 @@ class RustGenerator : public BaseGenerator { ...@@ -294,10 +294,7 @@ class RustGenerator : public BaseGenerator {
// structs, and tables) and output them to a single file. // structs, and tables) and output them to a single file.
bool generate() { bool generate() {
code_.Clear(); code_.Clear();
code_ += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n"; code_ += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
code_ += "#![allow(dead_code)]";
code_ += "#![allow(unused_imports)]";
code_ += "extern crate flatbuffers;\n";
assert(!cur_name_space_); assert(!cur_name_space_);
......
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
#![allow(dead_code)]
#![allow(unused_imports)]
extern crate flatbuffers;
pub mod my_game { pub mod my_game {
#![allow(dead_code)] #![allow(dead_code)]
#![allow(unused_imports)] #![allow(unused_imports)]
......
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
#![allow(dead_code)]
#![allow(unused_imports)]
extern crate flatbuffers;
pub mod namespace_a { pub mod namespace_a {
#![allow(dead_code)] #![allow(dead_code)]
#![allow(unused_imports)] #![allow(unused_imports)]
......
// automatically generated by the FlatBuffers compiler, do not modify // automatically generated by the FlatBuffers compiler, do not modify
#![allow(dead_code)]
#![allow(unused_imports)]
extern crate flatbuffers;
pub mod namespace_a { pub mod namespace_a {
#![allow(dead_code)] #![allow(dead_code)]
#![allow(unused_imports)] #![allow(unused_imports)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment