Parse a comma-separated list of patterns inside brackets.
(input: syn::parse::ParseStream)
| 42 | |
| 43 | /// Parse a comma-separated list of patterns inside brackets. |
| 44 | fn parse_pattern_list(input: syn::parse::ParseStream) -> syn::Result<Vec<Pattern>> { |
| 45 | let mut patterns = Vec::new(); |
| 46 | |
| 47 | while !input.is_empty() { |
| 48 | patterns.push(input.parse()?); |
| 49 | |
| 50 | if !input.is_empty() { |
| 51 | let _: Token![,] = input.parse()?; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | Ok(patterns) |
| 56 | } |