]> git.lizzy.rs Git - rust.git/commitdiff
Add PartialEq/Eq impls to proc_macro::{Spacing, Delimiter}
authorLukas Kalbertodt <lukas.kalbertodt@gmail.com>
Sun, 20 Aug 2017 21:20:34 +0000 (23:20 +0200)
committerGitHub <noreply@github.com>
Sun, 20 Aug 2017 21:20:34 +0000 (23:20 +0200)
I don't see a reason why those two types shouldn't be tested for equality.

src/libproc_macro/lib.rs

index 6a71e67676ae48a6abb364106b98e925d17358b0..92386d6d060248a989dd51eee2d9c80a2ce607bc 100644 (file)
@@ -241,7 +241,7 @@ pub enum TokenNode {
 }
 
 /// Describes how a sequence of token trees is delimited.
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
 #[unstable(feature = "proc_macro", issue = "38356")]
 pub enum Delimiter {
     /// `( ... )`
@@ -274,7 +274,7 @@ pub fn as_str(&self) -> &str {
 }
 
 /// Whether an `Op` is either followed immediately by another `Op` or followed by whitespace.
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
 #[unstable(feature = "proc_macro", issue = "38356")]
 pub enum Spacing {
     /// e.g. `+` is `Alone` in `+ =`.