clean up unnecessary outer rust gen-snippet (#5013)
authorcsmoe <csmoe@msn.com>
Wed, 24 Oct 2018 03:16:18 +0000 (11:16 +0800)
committerRobert <rw@users.noreply.github.com>
Wed, 24 Oct 2018 03:16:18 +0000 (20:16 -0700)
* clean up unneeded outer rust gen-snippet

* update generated rust file

src/idl_gen_rust.cpp
tests/monster_test_generated.rs
tests/namespace_test/namespace_test1_generated.rs
tests/namespace_test/namespace_test2_generated.rs

index 48858bd..6f06975 100644 (file)
@@ -294,10 +294,7 @@ class RustGenerator : public BaseGenerator {
   // structs, and tables) and output them to a single file.
   bool generate() {
     code_.Clear();
-    code_ += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
-    code_ += "#![allow(dead_code)]";
-    code_ += "#![allow(unused_imports)]";
-    code_ += "extern crate flatbuffers;\n";
+    code_ += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n"; 
 
     assert(!cur_name_space_);
 
index d61ea35..68e61ed 100644 (file)
@@ -1,10 +1,6 @@
 // automatically generated by the FlatBuffers compiler, do not modify
 
 
-#![allow(dead_code)]
-#![allow(unused_imports)]
-extern crate flatbuffers;
-
 pub mod my_game {
   #![allow(dead_code)]
   #![allow(unused_imports)]
index 42b1223..a2abf8f 100644 (file)
@@ -1,10 +1,6 @@
 // automatically generated by the FlatBuffers compiler, do not modify
 
 
-#![allow(dead_code)]
-#![allow(unused_imports)]
-extern crate flatbuffers;
-
 pub mod namespace_a {
   #![allow(dead_code)]
   #![allow(unused_imports)]
index f748a08..ac78936 100644 (file)
@@ -1,10 +1,6 @@
 // automatically generated by the FlatBuffers compiler, do not modify
 
 
-#![allow(dead_code)]
-#![allow(unused_imports)]
-extern crate flatbuffers;
-
 pub mod namespace_a {
   #![allow(dead_code)]
   #![allow(unused_imports)]