Skip to content

Commit

Permalink
Implement Eq for bool (FuelLabs#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadfawaz authored Mar 23, 2022
1 parent 30274cf commit 082bc8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ops.sw
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,15 @@ pub trait Eq {
fn eq(self, other: Self) -> bool;
}

impl Eq for bool {
fn eq(self, other: Self) -> bool {
asm(r1: self, r2: other, r3) {
eq r3 r1 r2;
r3: bool
}
}
}

impl Eq for u64 {
fn eq(self, other: Self) -> bool {
asm(r1: self, r2: other, r3) {
Expand Down

0 comments on commit 082bc8e

Please sign in to comment.