From 69652efe8ad9738a94fef571c8b81e342f96e7b4 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 7 Feb 2021 22:19:21 -0300 Subject: Finish porting parser --- tests/common/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/common') diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 48153af..9680504 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -24,7 +24,7 @@ use datafu::RefOwn; use datafu::PatternTypes; use datafu::KVPair; -#[derive(PartialEq, Eq, PartialOrd, Ord)] +#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)] pub enum Value { U(usize), B(bool), @@ -32,7 +32,7 @@ pub enum Value { S(Cow<'static, str>), } -#[derive(Copy, Clone, Eq, PartialEq)] +#[derive(Copy, Clone, Eq, PartialEq, Debug)] pub enum Dummy { } @@ -66,24 +66,28 @@ impl PartialEq for str { impl PartialEq for Value { fn eq(&self, other: &Dummy) -> bool { + let _ = other; unreachable!() } } impl PartialEq for Dummy { fn eq(&self, other: &Value) -> bool { + let _ = other; unreachable!() } } impl PartialEq for Dummy { fn eq(&self, other: &str) -> bool { + let _ = other; unreachable!() } } impl PartialEq for str { fn eq(&self, other: &Dummy) -> bool { + let _ = other; unreachable!() } } @@ -158,7 +162,7 @@ impl PatternTypes for Value { RefOwn::Ref(Value::M(map)) => { Some(match key { RefOwn::Ref(key) => map.get_key_value(key), - RefOwn::Own(key) => unreachable!(),//map.get_key_value(&Value::U(key)), + RefOwn::Own(_key) => unreachable!(), RefOwn::Str(key) => map.get_key_value(&key as &dyn ValueHelper), }.map(|(k,v)| (k.into(), v.into()))) }, -- cgit 1.4.1