summaryrefslogtreecommitdiff
path: root/src/chunkid.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-09 11:27:14 +0300
committerLars Wirzenius <liw@liw.fi>2022-04-16 09:04:28 +0300
commitd9b72ffa5485f3c253da22f09ff0a7090de7aa37 (patch)
treeffcfc0d0b2377c95072b609095589fbf83424382 /src/chunkid.rs
parent9f6ff22ff9a1b0a5a28d037846b1cecee4f2945c (diff)
downloadobnam2-d9b72ffa5485f3c253da22f09ff0a7090de7aa37.tar.gz
refactor: rename Checksum to Label
Label is a clearer and more accurate name for the type now that it is not just a checksum. Also, serialize a Label in tests, rather than using string literals. This is more correct, and we'll be changing serialization later. Sponsored-by: author
Diffstat (limited to 'src/chunkid.rs')
-rw-r--r--src/chunkid.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/chunkid.rs b/src/chunkid.rs
index 3534627..50fc3d3 100644
--- a/src/chunkid.rs
+++ b/src/chunkid.rs
@@ -3,7 +3,7 @@
//! Chunk identifiers are chosen by the server. Each chunk has a
//! unique identifier, which isn't based on the contents of the chunk.
-use crate::checksummer::Checksum;
+use crate::label::Label;
use rusqlite::types::ToSqlOutput;
use rusqlite::ToSql;
use serde::{Deserialize, Serialize};
@@ -53,8 +53,8 @@ impl ChunkId {
}
/// Return the SHA256 checksum of the identifier.
- pub fn sha256(&self) -> Checksum {
- Checksum::sha256(self.id.as_bytes())
+ pub fn sha256(&self) -> Label {
+ Label::sha256(self.id.as_bytes())
}
}