summaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-09 08:15:03 +0300
committerLars Wirzenius <liw@liw.fi>2022-04-16 09:04:12 +0300
commit9f6ff22ff9a1b0a5a28d037846b1cecee4f2945c (patch)
treeb5c56855f74c088775134fffbc88036176240968 /src/client.rs
parent8da3f80d296dc1891159fe4fdc1787cecd9730d0 (diff)
downloadobnam2-9f6ff22ff9a1b0a5a28d037846b1cecee4f2945c.tar.gz
refactor: add a Literal variant to Checksum
We've had fake checksums that are just arbitrary literal strings, and this change makes this more explicit. It's a preliminary change for later support for additional checksum algorithms. Sponsored-by: author
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index c5d66c1..563921d 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -1,5 +1,6 @@
//! Client to the Obnam server HTTP API.
+use crate::checksummer::Checksum;
use crate::chunk::{
ClientTrust, ClientTrustError, DataChunk, GenerationChunk, GenerationChunkError,
};
@@ -195,7 +196,8 @@ impl BackupClient {
}
async fn find_client_trusts(&self) -> Result<Vec<ChunkId>, ClientError> {
- let body = match self.get("", &[("label", "client-trust")]).await {
+ let label = format!("{}", Checksum::literal("client-trust"));
+ let body = match self.get("", &[("label", &label)]).await {
Ok((_, body)) => body,
Err(err) => return Err(err),
};