Skip to content

Commit

Permalink
fix(test-support): remove special case for $message_type
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Feb 9, 2024
1 parent 0ec197b commit c426fbe
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions crates/cargo-test-support/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,18 +596,6 @@ fn find_json_mismatch_r<'a>(
let mut expected_entries = l.iter();
let mut actual_entries = r.iter();

// Compilers older than 1.76 do not produce $message_type.
// Treat it as optional for now.
let mut expected_entries_without_message_type;
let expected_entries: &mut dyn Iterator<Item = _> =
if l.contains_key("$message_type") && !r.contains_key("$message_type") {
expected_entries_without_message_type =
expected_entries.filter(|entry| entry.0 != "$message_type");
&mut expected_entries_without_message_type
} else {
&mut expected_entries
};

loop {
match (expected_entries.next(), actual_entries.next()) {
(None, None) => return None,
Expand Down

0 comments on commit c426fbe

Please sign in to comment.