summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Chen <brianc118@fb.com>2022-04-18 13:53:48 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2022-04-18 13:53:48 -0700
commit4b05b09ac757021a5e8d68945e62c543f2eb18fb (patch)
treeb888bf83c9c186881ffc8f9c18c0207adb5af993
parent603d8e0d82cede43cc1aac2853391b656126624c (diff)
Implement traits for Field::U32
Summary: I missed implementing some traits for Field::U32. Reviewed By: dschatzberg Differential Revision: D35557842 fbshipit-source-id: 891a53d91a8bfee94389f5f26d63a31035332c7f
-rw-r--r--below/model/src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/below/model/src/lib.rs b/below/model/src/lib.rs
index 6313fdb7..b616d056 100644
--- a/below/model/src/lib.rs
+++ b/below/model/src/lib.rs
@@ -157,6 +157,7 @@ impl std::ops::Add for Field {
fn add(self, other: Self) -> Self {
match (self, other) {
+ (Field::U32(s), Field::U32(o)) => (s + o).into(),
(Field::U64(s), Field::U64(o)) => (s + o).into(),
(Field::I32(s), Field::I32(o)) => (s + o).into(),
(Field::I64(s), Field::I64(o)) => (s + o).into(),
@@ -171,6 +172,7 @@ impl std::ops::Add for Field {
impl PartialEq for Field {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
+ (Field::U32(s), Field::U32(o)) => s == o,
(Field::U64(s), Field::U64(o)) => s == o,
(Field::I32(s), Field::I32(o)) => s == o,
(Field::I64(s), Field::I64(o)) => s == o,
@@ -186,6 +188,7 @@ impl PartialEq for Field {
impl PartialOrd for Field {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
match (self, other) {
+ (Field::U32(s), Field::U32(o)) => s.partial_cmp(o),
(Field::U64(s), Field::U64(o)) => s.partial_cmp(o),
(Field::I32(s), Field::I32(o)) => s.partial_cmp(o),
(Field::I64(s), Field::I64(o)) => s.partial_cmp(o),