mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-22 03:23:05 +00:00
Fixed bug that only tested one file
This commit is contained in:
parent
117dcf9995
commit
0a3fe6675f
1 changed files with 6 additions and 1 deletions
7
build.rs
7
build.rs
|
@ -4,12 +4,17 @@ use std::fs;
|
|||
|
||||
fn main() {
|
||||
let paths = fs::read_dir("./pages/").unwrap();
|
||||
let mut vec = Vec::new();
|
||||
|
||||
// Convert paths to strings and add to vec
|
||||
for path in paths {
|
||||
let p = path.unwrap().path();
|
||||
let s = p.to_str().unwrap();
|
||||
if s.contains(".md") {
|
||||
skeptic::generate_doc_tests(&[s])
|
||||
vec.push(s.to_string());
|
||||
}
|
||||
}
|
||||
// Convert Vec<String> to Vec<str>
|
||||
let vec: Vec<_> = vec.iter().map(|s|&s[..]).collect();
|
||||
skeptic::generate_doc_tests(&vec);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue