feat(rm): added content/rm

This commit is contained in:
Kat Marchán 2019-05-24 17:14:06 -07:00
parent 837e90b484
commit eac29d941b
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
3 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,4 @@
pub mod path;
pub mod read;
pub mod write;
pub mod rm;

9
src/content/rm.rs Normal file
View File

@ -0,0 +1,9 @@
use crate::content::path;
use ssri::Integrity;
use std::io;
use std::fs;
use std::path::Path;
pub fn rm(cache: &Path, sri: &Integrity) -> io::Result<()> {
fs::remove_file(path::content_path(&cache, &sri))
}

View File

@ -1,4 +1,5 @@
mod content;
pub use crate::content::path;
pub use crate::content::read;
pub use crate::content::rm;
pub use crate::content::write;