From 345c5d822776ef78e594c2365d8bfd39202952e0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 23 Dec 2020 19:35:23 +0200 Subject: refactor: use a struct instead of a tuple It seems this is more idiomatic in Rust. --- src/bin/obnam-server.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/bin/obnam-server.rs') 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); -- cgit v1.2.1