reformat the world

This commit is contained in:
Aleksey Kladov
2019-02-08 14:49:43 +03:00
parent 5cb1d41a30
commit 12e3b4c70b
129 changed files with 727 additions and 2509 deletions

View File

@@ -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))
}
}

View File

@@ -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()
}