Skip to content

Commit

Permalink
Add PartialEq<char> for proc_macro::Punct
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 1, 2020
1 parent e8cbaf2 commit b017025
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/proc_macro/src/lib.rs
Expand Up @@ -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")]
Expand Down

0 comments on commit b017025

Please sign in to comment.