mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 06:05:17 +00:00
[Rust] Don't use inner attributes for allow (#5212)
* Don't use inner attributes for `allow` Messes with being able to easily include elsewhere * Regenerate tests * No-op to retrigger CI * Add the rest of the `allow` attributes
This commit is contained in:
@@ -1749,8 +1749,6 @@ class RustGenerator : public BaseGenerator {
|
||||
|
||||
void GenNamespaceImports(const int white_spaces) {
|
||||
std::string indent = std::string(white_spaces, ' ');
|
||||
code_ += indent + "#![allow(dead_code)]";
|
||||
code_ += indent + "#![allow(unused_imports)]";
|
||||
code_ += "";
|
||||
code_ += indent + "use std::mem;";
|
||||
code_ += indent + "use std::cmp::Ordering;";
|
||||
@@ -1792,6 +1790,7 @@ class RustGenerator : public BaseGenerator {
|
||||
// open namespace parts to reach the ns namespace
|
||||
// in the previous example, E, then F, then G are opened
|
||||
for (auto j = common_prefix_size; j != new_size; ++j) {
|
||||
code_ += "#[allow(unused_imports, dead_code)]";
|
||||
code_ += "pub mod " + MakeSnakeCase(ns->components[j]) + " {";
|
||||
// Generate local namespace imports.
|
||||
GenNamespaceImports(2);
|
||||
|
||||
Reference in New Issue
Block a user