mirror of https://github.com/zkat/cacache-rs.git
fix(cleanup): general house cleaning, bumping deps, etc
This commit is contained in:
parent
8d08e45298
commit
9163a58481
30
Cargo.toml
30
Cargo.toml
|
|
@ -15,24 +15,24 @@ categories = [
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ssri = "7.0.0"
|
ssri = "7.0.0"
|
||||||
hex = "0.4.0"
|
hex = "0.4.3"
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.2.0"
|
||||||
sha-1 = "0.8.1"
|
sha-1 = "0.9.8"
|
||||||
sha2 = "0.8.0"
|
sha2 = "0.9.8"
|
||||||
digest = "0.8.1"
|
digest = "0.9.0"
|
||||||
serde_json = "1.0.41"
|
serde_json = "1.0.68"
|
||||||
serde = "1.0.102"
|
serde = "1.0.130"
|
||||||
serde_derive = "1.0.102"
|
serde_derive = "1.0.130"
|
||||||
walkdir = "2.2.9"
|
walkdir = "2.3.2"
|
||||||
either = "1.5.3"
|
either = "1.6.1"
|
||||||
async-std = { version = "1.0.1", features = ["unstable"] }
|
async-std = { version = "1.10.0", features = ["unstable"] }
|
||||||
thiserror = "1.0.5"
|
thiserror = "1.0.29"
|
||||||
futures = "0.3.1"
|
futures = "0.3.17"
|
||||||
memmap = "0.7.0"
|
memmap = "0.7.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-attributes = "1.1.1"
|
async-attributes = "1.1.2"
|
||||||
criterion = "0.3.0"
|
criterion = "0.3.5"
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "benchmarks"
|
name = "benchmarks"
|
||||||
|
|
|
||||||
|
|
@ -267,14 +267,14 @@ fn bucket_path(cache: &Path, key: &str) -> PathBuf {
|
||||||
|
|
||||||
fn hash_key(key: &str) -> String {
|
fn hash_key(key: &str) -> String {
|
||||||
let mut hasher = Sha1::new();
|
let mut hasher = Sha1::new();
|
||||||
hasher.input(&key);
|
hasher.update(&key);
|
||||||
hex::encode(hasher.result())
|
hex::encode(hasher.finalize())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hash_entry(key: &str) -> String {
|
fn hash_entry(key: &str) -> String {
|
||||||
let mut hasher = Sha256::new();
|
let mut hasher = Sha256::new();
|
||||||
hasher.input(&key);
|
hasher.update(&key);
|
||||||
hex::encode(hasher.result())
|
hex::encode(hasher.finalize())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn now() -> u128 {
|
fn now() -> u128 {
|
||||||
|
|
|
||||||
12
src/rm.rs
12
src/rm.rs
|
|
@ -214,7 +214,7 @@ mod tests {
|
||||||
assert!(entry.is_some());
|
assert!(entry.is_some());
|
||||||
|
|
||||||
let data_exists = crate::exists(&dir, &sri).await;
|
let data_exists = crate::exists(&dir, &sri).await;
|
||||||
assert!(data_exists);
|
assert!(!data_exists);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -228,10 +228,10 @@ mod tests {
|
||||||
crate::clear(&dir).await.unwrap();
|
crate::clear(&dir).await.unwrap();
|
||||||
|
|
||||||
let entry = crate::metadata(&dir, "key").await.unwrap();
|
let entry = crate::metadata(&dir, "key").await.unwrap();
|
||||||
assert!(entry.is_some());
|
assert!(entry.is_none());
|
||||||
|
|
||||||
let data_exists = crate::exists(&dir, &sri).await;
|
let data_exists = crate::exists(&dir, &sri).await;
|
||||||
assert!(data_exists);
|
assert!(!data_exists);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,7 +244,7 @@ mod tests {
|
||||||
crate::remove_sync(&dir, "key").unwrap();
|
crate::remove_sync(&dir, "key").unwrap();
|
||||||
|
|
||||||
let new_entry = crate::metadata_sync(&dir, "key").unwrap();
|
let new_entry = crate::metadata_sync(&dir, "key").unwrap();
|
||||||
assert_eq!(new_entry, None);
|
assert!(new_entry.is_none());
|
||||||
|
|
||||||
let data_exists = crate::exists_sync(&dir, &sri);
|
let data_exists = crate::exists_sync(&dir, &sri);
|
||||||
assert!(data_exists);
|
assert!(data_exists);
|
||||||
|
|
@ -262,7 +262,7 @@ mod tests {
|
||||||
assert!(entry.is_some());
|
assert!(entry.is_some());
|
||||||
|
|
||||||
let data_exists = crate::exists_sync(&dir, &sri);
|
let data_exists = crate::exists_sync(&dir, &sri);
|
||||||
assert!(data_exists);
|
assert!(!data_exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
@ -277,6 +277,6 @@ mod tests {
|
||||||
assert_eq!(entry, None);
|
assert_eq!(entry, None);
|
||||||
|
|
||||||
let data_exists = crate::exists_sync(&dir, &sri);
|
let data_exists = crate::exists_sync(&dir, &sri);
|
||||||
assert!(data_exists);
|
assert!(!data_exists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue