Add PartialEq<char> for proc_macro::Punct

This commit is contained in:
David Tolnay 2020-11-01 09:30:04 -08:00
parent e8cbaf2ae7
commit b01702578d
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -842,6 +842,13 @@ impl fmt::Debug for Punct {
}
}
#[stable(feature = "proc_macro_punct_eq", since = "1.49.0")]
impl PartialEq<char> for Punct {
fn eq(&self, rhs: &char) -> bool {
self.as_char() == *rhs
}
}
/// An identifier (`ident`).
#[derive(Clone)]
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]