Skip to content

Commit

Permalink
fix new clippy lints (#1408)
Browse files Browse the repository at this point in the history
# Description

@swift-nav/devinfra

Minor change in a test function to fix a new clippy lint.

# API compatibility

Does this change introduce a API compatibility risk?

No

## API compatibility plan

If the above is "Yes", please detail the compatibility (or migration)
plan:

None

# JIRA Reference

N/A
  • Loading branch information
pcrumley committed Mar 26, 2024
1 parent 2f3e28e commit 0da32d5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rust/sbp/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,17 @@ mod tests {

#[test]
fn test_custom_event() {
enum ObsMsg {
Obs(MsgObs),
DepA(MsgObsDepA),
enum ObsMsgEvent {
Obs,
DepA,
}

impl Event for ObsMsg {
impl Event for ObsMsgEvent {
const MESSAGE_TYPES: &'static [u16] = &[MsgObs::MESSAGE_TYPE, MsgObsDepA::MESSAGE_TYPE];
fn from_sbp(msg: Sbp) -> Self {
match msg {
Sbp::MsgObs(m) => ObsMsg::Obs(m),
Sbp::MsgObsDepA(m) => ObsMsg::DepA(m),
Sbp::MsgObs(_m) => ObsMsgEvent::Obs,
Sbp::MsgObsDepA(_m) => ObsMsgEvent::DepA,
_ => unreachable!("wrong event keys"),
}
}
Expand All @@ -373,7 +373,7 @@ mod tests {
let link = source.link();
let count = RefCell::new(0);

link.register(|count: &RefCell<usize>, _: ObsMsg| {
link.register(|count: &RefCell<usize>, _: ObsMsgEvent| {
*count.borrow_mut() += 1;
});

Expand Down

0 comments on commit 0da32d5

Please sign in to comment.