Skip to content

Commit bccab83

Browse files
committed
Move helper functions out of expand_globs function
1 parent ce82d18 commit bccab83

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/expand.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ pub(crate) struct ExpandedTest {
1111
}
1212

1313
pub(crate) fn expand_globs(tests: &[Test]) -> Vec<ExpandedTest> {
14-
fn glob(pattern: &str) -> Result<Vec<PathBuf>> {
15-
let mut paths = glob::glob(pattern)?
16-
.map(|entry| entry.map_err(Error::from))
17-
.collect::<Result<Vec<PathBuf>>>()?;
18-
paths.sort();
19-
Ok(paths)
20-
}
21-
22-
fn bin_name(i: usize) -> Name {
23-
Name(format!("trybuild{:03}", i))
24-
}
25-
2614
let mut vec = Vec::new();
2715

2816
for test in tests {
@@ -56,3 +44,15 @@ pub(crate) fn expand_globs(tests: &[Test]) -> Vec<ExpandedTest> {
5644

5745
vec
5846
}
47+
48+
fn glob(pattern: &str) -> Result<Vec<PathBuf>> {
49+
let mut paths = glob::glob(pattern)?
50+
.map(|entry| entry.map_err(Error::from))
51+
.collect::<Result<Vec<PathBuf>>>()?;
52+
paths.sort();
53+
Ok(paths)
54+
}
55+
56+
fn bin_name(i: usize) -> Name {
57+
Name(format!("trybuild{:03}", i))
58+
}

0 commit comments

Comments
 (0)