Skip to content

Commit

Permalink
Merge branch 'master' into jakob/iote-6/amazon-timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jakalm committed Mar 26, 2024
2 parents 9495cd1 + 0da32d5 commit a8f30d4
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 a8f30d4

Please sign in to comment.