Skip to content

Commit

Permalink
Fix clippy warnings added in 1.73.0
Browse files Browse the repository at this point in the history
Fixed clippy recommendation regarding `filter_map`, see clippy lint
`filter_map_bool_then` for details.
  • Loading branch information
Edvin Åkerfeldt committed Oct 20, 2023
1 parent 992ca06 commit 96c0f3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mcan/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Tagging in git follows a pattern: `mcan/<version>`.

## [Unreleased]
- Adhere to `filter_map_bool_then` clippy lint.

## [0.3.0] - 2023-04-24

Expand Down
3 changes: 2 additions & 1 deletion mcan/src/rx_dedicated_buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ impl<'a, P: mcan_core::CanId, M: rx::AnyMessage> DynRxDedicatedBuffer
self.memory
.iter()
.enumerate()
.filter_map(|(i, m)| self.has_new_data(i).then(|| (i, m.get())))
.filter(|&(i, _)| self.has_new_data(i))
.map(|(i, m)| (i, m.get()))
.min_by_key(|(_, m)| m.id())
.map(|(i, m)| {
self.mark_buffer_read(i);
Expand Down

0 comments on commit 96c0f3f

Please sign in to comment.