Ensure we don't subtract with underflow getting enum names (#5246)

* Ensure we don't subtract with underflow getting enum names

* Yep - forgot to run this
This commit is contained in:
Matt Mastracci
2019-04-05 13:30:58 -06:00
committed by Wouter van Oortmerssen
parent 249f3b3714
commit c329d6fa90
3 changed files with 13 additions and 13 deletions

View File

@@ -84,8 +84,8 @@ const ENUM_NAMES_ENUM_IN_NESTED_NS:[&'static str; 3] = [
];
pub fn enum_name_enum_in_nested_ns(e: EnumInNestedNS) -> &'static str {
let index: usize = e as usize;
ENUM_NAMES_ENUM_IN_NESTED_NS[index]
let index = e as i8;
ENUM_NAMES_ENUM_IN_NESTED_NS[index as usize]
}
// struct StructInNestedNS, aligned to 4