use crate::{Build, FileSystemTree}; use std::{ fs::{create_dir, write}, io::Error, path::{Path, PathBuf}, }; impl Build for FileSystemTree where Name: AsRef + Ord, FileContent: AsRef<[u8]>, { type BorrowedPath = Path; type OwnedPath = PathBuf; fn join(prefix: &Self::BorrowedPath, name: &Name) -> Self::OwnedPath { prefix.join(name) } fn write_file(path: &Self::BorrowedPath, content: &Self::FileContent) -> Result<(), Error> { write(path, content) } fn create_dir(path: &Self::BorrowedPath) -> Result<(), Error> { create_dir(path) } }