mirror of https://github.com/zkat/cacache-rs.git
fix(fmt): cargo fmt
This commit is contained in:
parent
15f017fe21
commit
bc56a1b3fe
|
|
@ -1,10 +1,5 @@
|
||||||
use criterion::{
|
|
||||||
black_box,
|
|
||||||
Criterion,
|
|
||||||
criterion_group,
|
|
||||||
criterion_main
|
|
||||||
};
|
|
||||||
use cacache;
|
use cacache;
|
||||||
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||||
use tempfile;
|
use tempfile;
|
||||||
|
|
||||||
fn get(c: &mut Criterion) {
|
fn get(c: &mut Criterion) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
pub mod path;
|
pub mod path;
|
||||||
pub mod read;
|
pub mod read;
|
||||||
pub mod write;
|
|
||||||
pub mod rm;
|
pub mod rm;
|
||||||
|
pub mod write;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use std::path::{PathBuf, Path};
|
|
||||||
use ssri::Integrity;
|
use ssri::Integrity;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
const CONTENT_VERSION: &str = "2";
|
const CONTENT_VERSION: &str = "2";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,10 @@ pub fn find(cache: &Path, key: &str) -> Result<Option<Entry>, Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete(cache: &Path, key: &str) -> Result<(), Error> {
|
pub fn delete(cache: &Path, key: &str) -> Result<(), Error> {
|
||||||
insert(cache, key, PutOpts {
|
insert(
|
||||||
|
cache,
|
||||||
|
key,
|
||||||
|
PutOpts {
|
||||||
algorithm: None,
|
algorithm: None,
|
||||||
size: None,
|
size: None,
|
||||||
sri: None,
|
sri: None,
|
||||||
|
|
@ -100,7 +103,7 @@ pub fn delete(cache: &Path, key: &str) -> Result<(), Error> {
|
||||||
metadata: None,
|
metadata: None,
|
||||||
uid: None,
|
uid: None,
|
||||||
gid: None,
|
gid: None,
|
||||||
}
|
},
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ mod errors;
|
||||||
mod index;
|
mod index;
|
||||||
|
|
||||||
pub mod get;
|
pub mod get;
|
||||||
|
pub mod ls;
|
||||||
pub mod put;
|
pub mod put;
|
||||||
pub mod rm;
|
pub mod rm;
|
||||||
pub mod ls;
|
|
||||||
|
|
||||||
pub use errors::Error;
|
pub use errors::Error;
|
||||||
pub use index::Entry;
|
pub use index::Entry;
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,10 @@ impl PutOpts {
|
||||||
written: 0,
|
written: 0,
|
||||||
writer: write::Writer::new(
|
writer: write::Writer::new(
|
||||||
cache.as_ref(),
|
cache.as_ref(),
|
||||||
self.algorithm.as_ref().unwrap_or(&Algorithm::Sha256).clone()
|
self.algorithm
|
||||||
|
.as_ref()
|
||||||
|
.unwrap_or(&Algorithm::Sha256)
|
||||||
|
.clone(),
|
||||||
)?,
|
)?,
|
||||||
opts: self,
|
opts: self,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue