diff options
Diffstat (limited to 'client/src/download.rs')
-rw-r--r-- | client/src/download.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/client/src/download.rs b/client/src/download.rs index 4e2f0aa..44d613b 100644 --- a/client/src/download.rs +++ b/client/src/download.rs @@ -68,17 +68,14 @@ impl Downloader { } pub fn packet(&self, p: &Packet) -> Result<()> { let mut state = self.inner.write().unwrap(); - match p { - Packet::RespondResource(_, d) => { - let key = Resource(resource_hash(&d.0), PhantomData); - state.store.set_raw(&d.0)?; - state.need.remove(&key); - state.pending.remove(&key); - if state.have.insert(key) { - debug!("have {key}"); - } + if let Packet::RespondResource(_, d) = p { + let key = Resource(resource_hash(&d.0), PhantomData); + state.store.set_raw(&d.0)?; + state.need.remove(&key); + state.pending.remove(&key); + if state.have.insert(key) { + debug!("have {key}"); } - _ => (), } Ok(()) } |