mirror of
https://github.com/encounter/objdiff.git
synced 2025-06-07 07:03:39 +00:00
Fix highlighting of signed vs unsigned arguments (#202)
* Fix signed and unsigned arguments not being considered equal when highlighting * Remove unused Eq derive
This commit is contained in:
parent
2d643eb071
commit
731b604c24
@ -77,7 +77,7 @@ impl<'a> DiffTextSegment<'a> {
|
||||
const EOL_SEGMENT: DiffTextSegment<'static> =
|
||||
DiffTextSegment { text: DiffText::Eol, color: DiffTextColor::Normal, pad_to: 0 };
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub enum HighlightKind {
|
||||
#[default]
|
||||
None,
|
||||
@ -288,6 +288,18 @@ pub fn display_row(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl PartialEq<HighlightKind> for HighlightKind {
|
||||
fn eq(&self, other: &HighlightKind) -> bool {
|
||||
match (self, other) {
|
||||
(HighlightKind::Opcode(a), HighlightKind::Opcode(b)) => a == b,
|
||||
(HighlightKind::Argument(a), HighlightKind::Argument(b)) => a.loose_eq(b),
|
||||
(HighlightKind::Symbol(a), HighlightKind::Symbol(b)) => a == b,
|
||||
(HighlightKind::Address(a), HighlightKind::Address(b)) => a == b,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<DiffText<'_>> for HighlightKind {
|
||||
fn eq(&self, other: &DiffText) -> bool {
|
||||
match (self, other) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user