rust: Fixed MakeCamelCase (#4932) (#4936)

* Fixed MakeCamelCase behavior when supplied Upper_Camel_Case,
snake_case and UPPERCASE strings.
* Modified the rust integration test to reflect changes.
This commit is contained in:
jean-airoldie
2018-09-26 16:35:02 -04:00
committed by Robert
parent 49fed8c4f6
commit c56fff88a2
4 changed files with 18 additions and 12 deletions

View File

@@ -34,8 +34,8 @@ pub enum EnumInNestedNS {
}
const ENUM_MIN_ENUM_IN_NESTED_N_S: i8 = 0;
const ENUM_MAX_ENUM_IN_NESTED_N_S: i8 = 2;
const ENUM_MIN_ENUM_IN_NESTED_NS: i8 = 0;
const ENUM_MAX_ENUM_IN_NESTED_NS: i8 = 2;
impl<'a> flatbuffers::Follow<'a> for EnumInNestedNS {
type Inner = Self;
@@ -69,22 +69,22 @@ impl flatbuffers::Push for EnumInNestedNS {
}
#[allow(non_camel_case_types)]
const ENUM_VALUES_ENUM_IN_NESTED_N_S:[EnumInNestedNS; 3] = [
const ENUM_VALUES_ENUM_IN_NESTED_NS:[EnumInNestedNS; 3] = [
EnumInNestedNS::A,
EnumInNestedNS::B,
EnumInNestedNS::C
];
#[allow(non_camel_case_types)]
const ENUM_NAMES_ENUM_IN_NESTED_N_S:[&'static str; 3] = [
const ENUM_NAMES_ENUM_IN_NESTED_NS:[&'static str; 3] = [
"A",
"B",
"C"
];
pub fn enum_name_enum_in_nested_n_s(e: EnumInNestedNS) -> &'static str {
pub fn enum_name_enum_in_nested_ns(e: EnumInNestedNS) -> &'static str {
let index: usize = e as usize;
ENUM_NAMES_ENUM_IN_NESTED_N_S[index]
ENUM_NAMES_ENUM_IN_NESTED_NS[index]
}
// struct StructInNestedNS, aligned to 4