diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-03-21 17:15:51 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-03-22 19:18:35 +0200 |
commit | 7e49a52cee01a26b91253abb38dcc40b5ae727e2 (patch) | |
tree | 8077400c09864e3208eb042f7c70d4afae3988b1 /src/chunk.rs | |
parent | 48139725676fcce89a70897546969623f2474693 (diff) | |
download | obnam2-7e49a52cee01a26b91253abb38dcc40b5ae727e2.tar.gz |
feat! drop generation related fields from chunk metadata
Sponsored-by: author
Diffstat (limited to 'src/chunk.rs')
-rw-r--r-- | src/chunk.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/chunk.rs b/src/chunk.rs index 238bd01..27a3ab9 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -93,12 +93,12 @@ impl GenerationChunk { } /// Convert generation chunk to a data chunk. - pub fn to_data_chunk(&self, ended: &str) -> Result<DataChunk, GenerationChunkError> { + pub fn to_data_chunk(&self) -> Result<DataChunk, GenerationChunkError> { let json: String = serde_json::to_string(self).map_err(GenerationChunkError::JsonGenerate)?; let bytes = json.as_bytes().to_vec(); let checksum = Checksum::sha256(&bytes); - let meta = ChunkMeta::new_generation(&checksum, ended); + let meta = ChunkMeta::new(&checksum); Ok(DataChunk::new(bytes, meta)) } } @@ -186,7 +186,7 @@ impl ClientTrust { let json: String = serde_json::to_string(self).map_err(ClientTrustError::JsonGenerate)?; let bytes = json.as_bytes().to_vec(); let checksum = Checksum::sha256_from_str_unchecked("client-trust"); - let meta = ChunkMeta::new_generation(&checksum, ""); + let meta = ChunkMeta::new(&checksum); Ok(DataChunk::new(bytes, meta)) } |