From 6be50f7d5de3737464853a589673375fc0cafa97 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 31 Oct 2018 23:41:43 +0300 Subject: Reformat all --- crates/test_utils/src/lib.rs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'crates/test_utils/src') diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 8980f077f..d9fbb9b5b 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -89,7 +89,6 @@ pub fn add_cursor(text: &str, offset: TextUnit) -> String { res } - #[derive(Debug)] pub struct FixtureEntry { pub meta: String, @@ -112,25 +111,29 @@ pub fn parse_fixture(fixture: &str) -> Vec { macro_rules! flush { () => { if let Some(meta) = meta { - res.push(FixtureEntry { meta: meta.to_string(), text: buf.clone() }); + res.push(FixtureEntry { + meta: meta.to_string(), + text: buf.clone(), + }); buf.clear(); } }; }; - let margin = fixture.lines() + let margin = fixture + .lines() .filter(|it| it.trim_start().starts_with("//-")) .map(|it| it.len() - it.trim_start().len()) - .next().expect("empty fixture"); - let lines = fixture.lines() - .filter_map(|line| { - if line.len() >= margin { - assert!(line[..margin].trim().is_empty()); - Some(&line[margin..]) - } else { - assert!(line.trim().is_empty()); - None - } - }); + .next() + .expect("empty fixture"); + let lines = fixture.lines().filter_map(|line| { + if line.len() >= margin { + assert!(line[..margin].trim().is_empty()); + Some(&line[margin..]) + } else { + assert!(line.trim().is_empty()); + None + } + }); for line in lines { if line.starts_with("//-") { -- cgit v1.2.3