diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-27 21:47:26 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-27 21:47:26 +0200 |
| commit | 2a92428ff6986d8e564b7c223f3d0c5ca0eacaf1 (patch) | |
| tree | 4545b5b598aa95cb23b6737884b5b6e2ee8c0a33 /src/compute/value.rs | |
| parent | 37835e4d8e5029c857ba4f11b8c2a09563423746 (diff) | |
Do as Dolores says ⚡
Diffstat (limited to 'src/compute/value.rs')
| -rw-r--r-- | src/compute/value.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compute/value.rs b/src/compute/value.rs index c11a3d31..bac6396d 100644 --- a/src/compute/value.rs +++ b/src/compute/value.rs @@ -132,9 +132,7 @@ impl PartialEq for Value { (Color(a), Color(b)) => a == b, (Table(a), Table(b)) => a == b, (Tree(a), Tree(b)) => a == b, - (Func(a), Func(b)) => { - a.as_ref() as *const _ == b.as_ref() as *const _ - } + (Func(a), Func(b)) => Rc::ptr_eq(a, b), (Commands(a), Commands(b)) => a == b, _ => false, } @@ -202,7 +200,7 @@ impl TableValue { /// there is any. /// /// Generates an error if the key exists but the value does not match. - pub fn take_key<'a, T>(&mut self, key: &str, f: &mut Feedback) -> Option<T> + pub fn take_key<T>(&mut self, key: &str, f: &mut Feedback) -> Option<T> where T: TryFromValue, { |
