aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/store.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/store.rs')
-rw-r--r--src/api/store.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/api/store.rs b/src/api/store.rs
index bd4ae8e..c67df85 100644
--- a/src/api/store.rs
+++ b/src/api/store.rs
@@ -24,6 +24,7 @@ use super::{ApiError, store_status};
use crate::document::meta;
use crate::document::store::{self, StoreError, paths_related};
use crate::state::{AppState, ReadSource};
+use crate::transport::Hex;
#[derive(Debug, Default, Deserialize)]
pub(crate) struct ReadQuery {
@@ -209,13 +210,7 @@ pub(crate) async fn put_store_entry(
}
fn etag_for(bytes: &[u8]) -> String {
- let digest = Sha256::digest(bytes);
- let hex = digest
- .iter()
- .map(|byte| format!("{byte:02x}"))
- .collect::<String>();
-
- format!("\"{hex}\"")
+ format!("\"{}\"", Hex(&Sha256::digest(bytes)))
}
fn parse_key_path(key: &str) -> Result<Vec<String>, StatusCode> {