Use ArrayString instead of hand rolled data structure

This commit is contained in:
Adolfo Ochagavía 2018-11-07 11:58:34 +01:00
parent e37ba706cc
commit 3b2ba59526
5 changed files with 6 additions and 39 deletions

View file

@ -1,11 +1,12 @@
use std::u32;
use arrayvec::ArrayString;
use crate::{
algo::visit::{visitor_ctx, VisitorCtx},
ast::{self, AstNode},
File,
string_lexing::{self, CharComponentKind},
utils::MutAsciiString,
yellow::{
SyntaxError,
SyntaxErrorKind::*,
@ -76,8 +77,7 @@ fn validate_char(node: ast::Char, errors: &mut Vec<SyntaxError>) {
return;
}
let mut buf = &mut [0; 6];
let mut code = MutAsciiString::new(buf);
let mut code = ArrayString::<[_; 6]>::new();
let mut closed = false;
for c in text[3..].chars() {
assert!(!closed, "no characters after escape is closed");