use crate::EntryWriteError;
use crate::{get_entry, EntryType};
use std::path::Path;
pub fn remove
(path: P) -> Result<(), EntryWriteError>
where
P: AsRef,
{
let entry = get_entry(&path)?;
match entry.entry_type {
EntryType::File => std::fs::remove_file(&path)?,
EntryType::Directory => std::fs::remove_dir_all(&path)?,
}
Ok(())
}
pub fn remove_file(path: P) -> Result<(), EntryWriteError>
where
P: AsRef,
{
std::fs::remove_file(path)?;
Ok(())
}