summaryrefslogtreecommitdiff
path: root/src/bin/obnam-server.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-23 19:35:23 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-23 19:35:23 +0200
commit345c5d822776ef78e594c2365d8bfd39202952e0 (patch)
tree37fbdb673eb03c63c8a909540a885d82d0225357 /src/bin/obnam-server.rs
parent4128b937a6bd1ea3944a6a7f00930d40f27f2d2a (diff)
downloadobnam2-345c5d822776ef78e594c2365d8bfd39202952e0.tar.gz
refactor: use a struct instead of a tuple
It seems this is more idiomatic in Rust.
Diffstat (limited to 'src/bin/obnam-server.rs')
-rw-r--r--src/bin/obnam-server.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/obnam-server.rs b/src/bin/obnam-server.rs
index e695870..dc8aa82 100644
--- a/src/bin/obnam-server.rs
+++ b/src/bin/obnam-server.rs
@@ -163,9 +163,11 @@ pub async fn fetch_chunk(
let store = store.lock().await;
let id: ChunkId = id.parse().unwrap();
match store.load(&id) {
- Ok((meta, chunk)) => {
+ Ok(loaded) => {
+ let meta = loaded.meta().clone();
+ let data = loaded.data().clone();
info!("found chunk {}: {:?}", id, meta);
- Ok(ChunkResult::Fetched(meta, chunk))
+ Ok(ChunkResult::Fetched(meta, data))
}
Err(e) => {
error!("chunk not found: {}: {:?}", id, e);