Skip to content

Commit b017025

Browse files
committed
Add PartialEq<char> for proc_macro::Punct
1 parent e8cbaf2 commit b017025

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/proc_macro/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,13 @@ impl fmt::Debug for Punct {
842842
}
843843
}
844844

845+
#[stable(feature = "proc_macro_punct_eq", since = "1.49.0")]
846+
impl PartialEq<char> for Punct {
847+
fn eq(&self, rhs: &char) -> bool {
848+
self.as_char() == *rhs
849+
}
850+
}
851+
845852
/// An identifier (`ident`).
846853
#[derive(Clone)]
847854
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]

0 commit comments

Comments
 (0)