From c121d94f0b27bc04ffbdca55cd0939c1401d5a2e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 27 Jan 2025 15:26:00 +0100 Subject: clippy: fixes and ignores --- client/src/download.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'client/src/download.rs') 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(()) } -- cgit v1.2.3-70-g09d2