pub fn file_generator(interpreter: super::super::Interpreter) -> impl Stream<Item = String> {
    let generator = stream! {
        // is it recursive? ok, use the library
        // no? we use our implementation
        if interpreter.__recursive__ {
            for e in WalkDir::new(&interpreter.__directory__)
                .into_iter()
                .filter_map(|e| e.ok())
            {
                if e.metadata().unwrap().is_file() {
                    yield e.path().display().to_string();
                }
            }
            return;
        } else {
            for entry in fs::read_dir(&interpreter.__directory__).unwrap() {
                let p = entry.unwrap().path();
                let path = p.absolutize().unwrap();
                let metadata = fs::metadata(&path).unwrap();
                if metadata.is_file() {
                    yield path.to_str().unwrap().to_string();
                } else {
                    // next please
                    continue;
                }
            }
            return;
        }
    };
    return generator;
}
// the compiler gets angry if I try to return that inside an impl of a trait
the compiler gets angry if I try to return that inside an impl of a trait
the compiler gets angry if I try to return that inside an impl of a trait
pub fn file_generator(interpreter: super::super::Interpreter) -> impl Stream<Item = String> {
    let generator = stream! {
        // is it recursive? ok, use the library
        // no? we use our implementation
        if interpreter.__recursive__ {
            for e in WalkDir::new(&interpreter.__directory__)
                .into_iter()
                .filter_map(|e| e.ok())
            {
                if e.metadata().unwrap().is_file() {
                    yield e.path().display().to_string();
                }
            }
            return;
        } else {
            for entry in fs::read_dir(&interpreter.__directory__).unwrap() {
                let p = entry.unwrap().path();
                let path = p.absolutize().unwrap();
                let metadata = fs::metadata(&path).unwrap();
                if metadata.is_file() {
                    yield path.to_str().unwrap().to_string();
                } else {
                    // next please
                    continue;
                }
            }
            return;
        }
    };
    return generator;
}
pub fn file_generator ( interpreter : super :: super :: Interpreter ) -> impl Stream < Item = String > { let generator = stream ! { // is it recursive? ok, use the library // no? we use our implementation if interpreter recursive__ { for e in WalkDir new ( interpreter directory__ ) into_iter ( ) filter_map ( e e ok ( ) ) { if e metadata ( ) unwrap ( ) is_file ( ) { yield e path ( ) display ( ) to_string ( ) } } return } else { for entry in fs read_dir ( interpreter directory__ ) unwrap ( ) { let p entry unwrap ( ) path ( ) let path p absolutize ( ) unwrap ( ) let metadata fs metadata ( path ) unwrap ( ) if metadata is_file ( ) { yield path to_str ( ) unwrap ( ) to_string ( ) } else { // next please continue } } return } } ; return generator ; }
the compiler gets angry if I try to return that inside an impl of a trait
the compiler gets angry if I try to return that inside an impl of a trait
interpreter
super::super::Interpreter
interpreter
super::super::Interpreter