reformat the world
This commit is contained in:
@@ -24,9 +24,7 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
|
||||
pub fn advance(&mut self) -> char {
|
||||
let next = self
|
||||
.peek()
|
||||
.expect("cannot advance if end of input is reached");
|
||||
let next = self.peek().expect("cannot advance if end of input is reached");
|
||||
self.pos += next.len_utf8();
|
||||
next
|
||||
}
|
||||
@@ -133,10 +131,7 @@ impl<'a> Parser<'a> {
|
||||
Some(self.parse_escape(start))
|
||||
} else {
|
||||
let end = self.get_pos();
|
||||
Some(StringComponent::new(
|
||||
TextRange::from_to(start, end),
|
||||
CodePoint,
|
||||
))
|
||||
Some(StringComponent::new(TextRange::from_to(start, end), CodePoint))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,12 +120,7 @@ mod tests {
|
||||
fn closed_char_component(src: &str) -> StringComponent {
|
||||
let (has_closing_quote, components) = parse(src);
|
||||
assert!(has_closing_quote, "char should have closing quote");
|
||||
assert!(
|
||||
components.len() == 1,
|
||||
"Literal: {}\nComponents: {:#?}",
|
||||
src,
|
||||
components
|
||||
);
|
||||
assert!(components.len() == 1, "Literal: {}\nComponents: {:#?}", src, components);
|
||||
components[0].clone()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user