From 82ff782fe85c84c10f1f18c9bd5c2b017bc2f240 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 9 Apr 2022 09:40:59 +0300 Subject: feat! change how chunk labels are serialized Serialized labels now start with a type prefix: a character that says what type of label it is. This isn't strictly required: we _can_ just decide to always use a single type of checksum for all chunks in one backup, for one client, or in the whole repository. However, if it's ever possible to have more than one type, it helps debugging if every checksum, when serialized, is explicit about its type. Change things to use the new serialize method instead of the Display trait for Label. We're primarily serializing labels so they can be stored in a database, and used in URLs, only secondarily showing them to users. Sponsored-by: author --- src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client.rs') diff --git a/src/client.rs b/src/client.rs index d8bf262..bed5f1e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -196,7 +196,7 @@ impl BackupClient { } async fn find_client_trusts(&self) -> Result, ClientError> { - let label = format!("{}", Label::literal("client-trust")); + let label = Label::literal("client-trust").serialize(); let body = match self.get("", &[("label", &label)]).await { Ok((_, body)) => body, Err(err) => return Err(err), -- cgit v1.2.1