diff options
author | David Tolnay <dtolnay@gmail.com> | 2020-03-06 10:21:35 -0800 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2020-03-06 10:21:35 -0800 |
commit | 438e26034c8b62dcadb0f83e2ea32cdd7bd05d8f (patch) | |
tree | e8cb7a7962707c673dbfcb49267d6e9215b99fb8 /syntax/atom.rs | |
parent | ba5eb2de8cbd6fd2b033203b4c3c2d87e8b9f534 (diff) | |
download | cxx-438e26034c8b62dcadb0f83e2ea32cdd7bd05d8f.tar.gz |
Make PartialEq work with reference lhs
Diffstat (limited to 'syntax/atom.rs')
-rw-r--r-- | syntax/atom.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/syntax/atom.rs b/syntax/atom.rs index 903f5610..9fb6554d 100644 --- a/syntax/atom.rs +++ b/syntax/atom.rs @@ -54,3 +54,15 @@ impl PartialEq<Atom> for Type { } } } + +impl PartialEq<Atom> for &Ident { + fn eq(&self, atom: &Atom) -> bool { + *self == atom + } +} + +impl PartialEq<Atom> for &Type { + fn eq(&self, atom: &Atom) -> bool { + *self == atom + } +} |