Replace as casts with type-conversion functions.

This commit is contained in:
Dan Gohman
2017-11-08 10:41:09 -08:00
parent 7c579a80c2
commit 889b06fd16
15 changed files with 54 additions and 47 deletions

View File

@@ -352,7 +352,7 @@ impl<'a> Lexer<'a> {
_ => return None,
};
if is_vector {
if number <= u16::MAX as u32 {
if number <= u32::from(u16::MAX) {
base_type.by(number as u16).map(Token::Type)
} else {
None