galvan-files 0.0.0-dev01

Locates galvan files in a directory, checks naming conventions and generates artifact names.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::path::Path;
use walkdir::WalkDir;
use crate::{GalvanFileExtension, Source, SourceResult};

pub fn read_sources(path: impl AsRef<Path>) -> impl Iterator<Item = SourceResult> {
    WalkDir::new(path)
        .into_iter()
        .filter_map(|e| e.ok())
        .map(|e| e.into_path())
        .filter(|p| p.has_galvan_extension())
        .map(Source::read)
}