dirwalk 1.1.1

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

pub fn write<E: Borrow<Entry> + Serialize>(w: &mut impl Write, entries: &[E]) -> io::Result<()> {
    let json = serde_json::to_string_pretty(entries).map_err(io::Error::other)?;
    writeln!(w, "{}", json)
}