Skip to content

Commit 5e1ae1d

Browse files
author
Veetaha
committed
test_utils: move flush!() to its usage as per conversation with @matklad
1 parent d3472e8 commit 5e1ae1d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

crates/test_utils/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,6 @@ pub struct FixtureEntry {
169169
/// // - other meta
170170
/// ```
171171
pub fn parse_fixture(fixture: &str) -> Vec<FixtureEntry> {
172-
let mut res = Vec::new();
173-
let mut buf = String::new();
174-
let mut meta: Option<&str> = None;
175-
176-
macro_rules! flush {
177-
() => {
178-
if let Some(meta) = meta {
179-
res.push(FixtureEntry { meta: meta.to_string(), text: buf.clone() });
180-
buf.clear();
181-
}
182-
};
183-
};
184-
185172
let margin = fixture
186173
.lines()
187174
.filter(|it| it.trim_start().starts_with("//-"))
@@ -201,6 +188,19 @@ pub fn parse_fixture(fixture: &str) -> Vec<FixtureEntry> {
201188
}
202189
});
203190

191+
let mut res = Vec::new();
192+
let mut buf = String::new();
193+
let mut meta: Option<&str> = None;
194+
195+
macro_rules! flush {
196+
() => {
197+
if let Some(meta) = meta {
198+
res.push(FixtureEntry { meta: meta.to_string(), text: buf.clone() });
199+
buf.clear();
200+
}
201+
};
202+
};
203+
204204
for line in lines {
205205
if line.starts_with("//-") {
206206
flush!();

0 commit comments

Comments
 (0)