Skip to content

Suspicious Eq impl on JSONEntry #53

@TomAFrench

Description

@TomAFrench

impl std::cmp::Eq for JSONEntry {
// N.B. used for testing
fn eq(self, other: Self) -> bool {
let array_ptr = (self.array_pointer == other.array_pointer);
let entry = self.entry_type == other.entry_type;
let child = (self.child_pointer == other.child_pointer);
let num_children = (self.num_children == other.num_children);
let json_pointer = (self.json_pointer == other.json_pointer);
let json_length = (self.json_length == other.json_length);
array_ptr | entry | child | num_children | json_pointer | json_length
}
}

This reports two values as equal if any one of their fields match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    👀 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions