From 12e3b4c70b5ef23b2fdfc197296d483680e125f9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:49:43 +0300 Subject: reformat the world --- crates/ra_syntax/src/string_lexing/parser.rs | 9 ++------- crates/ra_syntax/src/string_lexing/string.rs | 7 +------ 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'crates/ra_syntax/src/string_lexing') diff --git a/crates/ra_syntax/src/string_lexing/parser.rs b/crates/ra_syntax/src/string_lexing/parser.rs index e835382fc..7469eb903 100644 --- a/crates/ra_syntax/src/string_lexing/parser.rs +++ b/crates/ra_syntax/src/string_lexing/parser.rs @@ -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)) } } diff --git a/crates/ra_syntax/src/string_lexing/string.rs b/crates/ra_syntax/src/string_lexing/string.rs index 064f08544..a4742a0d1 100644 --- a/crates/ra_syntax/src/string_lexing/string.rs +++ b/crates/ra_syntax/src/string_lexing/string.rs @@ -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() } -- cgit v1.2.3