From d9b72ffa5485f3c253da22f09ff0a7090de7aa37 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 9 Apr 2022 11:27:14 +0300 Subject: 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 --- src/chunker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/chunker.rs') diff --git a/src/chunker.rs b/src/chunker.rs index 7954621..2394230 100644 --- a/src/chunker.rs +++ b/src/chunker.rs @@ -1,8 +1,8 @@ //! Split file data into chunks. -use crate::checksummer::Checksum; use crate::chunk::DataChunk; use crate::chunkmeta::ChunkMeta; +use crate::label::Label; use std::io::prelude::*; use std::path::{Path, PathBuf}; @@ -54,7 +54,7 @@ impl FileChunks { } let buffer = &self.buf.as_slice()[..used]; - let hash = Checksum::sha256(buffer); + let hash = Label::sha256(buffer); let meta = ChunkMeta::new(&hash); let chunk = DataChunk::new(buffer.to_vec(), meta); Ok(Some(chunk)) -- cgit v1.2.1