Document Path::parse_mod_style
diff --git a/src/path.rs b/src/path.rs
index ff7e754..fea3b0f 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -346,6 +346,40 @@
}
impl Path {
+ /// Parse a `Path` containing no path arguments on any of its segments.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// # extern crate syn;
+ /// #
+ /// use syn::{Path, Token};
+ /// use syn::parse::{Parse, ParseStream, Result};
+ ///
+ /// // A simplified single `use` statement like:
+ /// //
+ /// // use std::collections::HashMap;
+ /// //
+ /// // Note that generic parameters are not allowed in a `use` statement
+ /// // so the following must not be accepted.
+ /// //
+ /// // use a::<b>::c;
+ /// struct SingleUse {
+ /// use_token: Token![use],
+ /// path: Path,
+ /// }
+ ///
+ /// impl Parse for SingleUse {
+ /// fn parse(input: ParseStream) -> Result<Self> {
+ /// Ok(SingleUse {
+ /// use_token: input.parse()?,
+ /// path: input.call(Path::parse_mod_style)?,
+ /// })
+ /// }
+ /// }
+ /// #
+ /// # fn main() {}
+ /// ```
pub fn parse_mod_style(input: ParseStream) -> Result<Self> {
Ok(Path {
leading_colon: input.parse()?,