summaryrefslogtreecommitdiff
path: root/src/server.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/server.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/server.rs')
-rw-r--r--src/server.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.rs b/src/server.rs
index 31a03fc..6b688d6 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -141,7 +141,7 @@ impl SearchHits {
#[cfg(test)]
mod test_search_hits {
use super::{ChunkMeta, SearchHits};
- use crate::checksummer::Checksum;
+ use crate::label::Label;
#[test]
fn no_search_hits() {
@@ -152,7 +152,7 @@ mod test_search_hits {
#[test]
fn one_search_hit() {
let id = "abc".parse().unwrap();
- let sum = Checksum::sha256_from_str_unchecked("123");
+ let sum = Label::sha256(b"123");
let meta = ChunkMeta::new(&sum);
let mut hits = SearchHits::default();
hits.insert(id, meta);