From d2a3f4f36832bb2f57c3f3e88e64bddb36d045e2 Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Thu, 16 Jan 2025 10:08:37 -0500 Subject: [PATCH] clippy: deny only_used_in_recursion --- Cargo.toml | 1 - capsules/extra/src/mx25r6435f.rs | 20 +++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ffc16810da..2c0d6aa856 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -154,7 +154,6 @@ option_map_unit_fn = "allow" nonminimal_bool = "allow" identity-op = "allow" while-let-loop = "allow" -only_used_in_recursion = "allow" manual-range-patterns = "allow" manual-flatten = "allow" diff --git a/capsules/extra/src/mx25r6435f.rs b/capsules/extra/src/mx25r6435f.rs index d42c807b3f..5bae729d56 100644 --- a/capsules/extra/src/mx25r6435f.rs +++ b/capsules/extra/src/mx25r6435f.rs @@ -412,7 +412,12 @@ impl< self.rxbuffer.replace(read_buffer); self.client.map(move |client| { - client.read_complete(sector, Ok(())); + client.read_complete( + sector, + read_write_status + .and(Ok(())) + .or(Err(hil::flash::Error::FlashError)), + ); }); } else { let address = @@ -488,7 +493,11 @@ impl< self.state.set(State::Idle); self.txbuffer.replace(write_buffer); self.client.map(|client| { - client.erase_complete(Ok(())); + client.erase_complete( + read_write_status + .and(Ok(())) + .or(Err(hil::flash::Error::FlashError)), + ); }); } State::WriteSectorWriteEnable { @@ -503,7 +512,12 @@ impl< self.txbuffer.replace(write_buffer); self.client.map(|client| { self.client_sector.take().map(|sector| { - client.write_complete(sector, Ok(())); + client.write_complete( + sector, + read_write_status + .and(Ok(())) + .or(Err(hil::flash::Error::FlashError)), + ); }); }); } else {