Change Lit::short_name to Lit::literal_name.

This avoids a moderately hot allocation in `parse_lit_token`.
This commit is contained in:
Nicholas Nethercote
2018-11-12 14:38:44 +11:00
parent 5a2ca1a6f1
commit c6862992d9
2 changed files with 8 additions and 8 deletions

View File

@@ -1956,7 +1956,7 @@ impl<'a> Parser<'a> {
if suffix_illegal {
let sp = self.span;
self.expect_no_suffix(sp, &format!("{} literal", lit.short_name()), suf)
self.expect_no_suffix(sp, lit.literal_name(), suf)
}
result.unwrap()