dirwalk 1.1.1

Platform-optimized recursive directory walker with metadata
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::entry::Entry;
use std::borrow::Borrow;
use std::io::{self, Write};

pub fn write<E: Borrow<Entry>>(w: &mut impl Write, entries: &[E]) -> io::Result<()> {
    for e in entries {
        let line = serde_json::to_string(e.borrow()).map_err(io::Error::other)?;
        writeln!(w, "{}", line)?;
    }
    Ok(())
}