Skip to content

Commit

Permalink
Merge pull request #92 from alexcrichton/eq
Browse files Browse the repository at this point in the history
Ident == AsRef<str>
  • Loading branch information
alexcrichton authored May 18, 2018
2 parents 3d9d6ad + c0bbcc5 commit 06a1da7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,15 @@ impl PartialEq for Ident {
}
}

impl<T> PartialEq<T> for Ident
where
T: ?Sized + AsRef<str>,
{
fn eq(&self, other: &T) -> bool {
self.to_string() == other.as_ref()
}
}

impl Eq for Ident {}

impl PartialOrd for Ident {
Expand Down

0 comments on commit 06a1da7

Please sign in to comment.