Add path comparison Path::is_ident
diff --git a/src/path.rs b/src/path.rs
index 301a06b..7c1f78d 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -93,6 +93,13 @@
             PathArguments::Parenthesized(_) => false,
         }
     }
+
+    fn is_none(&self) -> bool {
+        match *self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => false,
+        }
+    }
 }
 
 ast_enum! {
@@ -423,6 +430,26 @@
             })
         }
 
+        /// Determines whether this is a path of length 1 equal to the given
+        /// ident.
+        ///
+        /// For them to compare equal, it must be the case that:
+        ///
+        /// - the path has no leading colon,
+        /// - the number of path segments is 1,
+        /// - the first path segment has no angle bracketed or parenthesized
+        ///   path arguments
+        /// - and the ident of the first path segment is equal to the given one.
+        pub fn is_ident<I>(&self, ident: I) -> bool
+        where
+            Ident: PartialEq<I>,
+        {
+            self.leading_colon.is_none()
+                && self.segments.len() == 1
+                && self.segments[0].arguments.is_none()
+                && self.segments[0].ident == ident
+        }
+
         fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
             if input.peek(Token![dyn]) {
                 return Err(input.error("expected path"));