Skip to content

Commit

Permalink
[echoscu] Tweak msg_id check to avoid type inference bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Mar 1, 2024
1 parent 7f0704a commit cacc762
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions echoscu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,13 @@ fn run() -> Result<(), Whatever> {
}

// msg ID response, should be equal to sent msg ID
let msg_id_elem = obj
let got_msg_id: u16 = obj
.element(tags::MESSAGE_ID_BEING_RESPONDED_TO)
.whatever_context("Could not retrieve Message ID from response")?;
.whatever_context("Could not retrieve Message ID from response")?
.to_int()
.whatever_context("Message ID is not a valid integer")?;

if message_id
!= msg_id_elem
.to_int()
.whatever_context("Message ID is not a valid integer")?
{
if message_id != got_msg_id {
whatever!("Message ID mismatch");
}
}
Expand Down

0 comments on commit cacc762

Please sign in to comment.