mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Use ArrayString instead of hand rolled data structure
This commit is contained in:
parent
e37ba706cc
commit
3b2ba59526
5 changed files with 6 additions and 39 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue