MCPcopy Index your code
hub / github.com/carllerche/assert-struct / parse_pattern_list

Function parse_pattern_list

assert-struct-macros/src/pattern/slice.rs:44–56  ·  view source on GitHub ↗

Parse a comma-separated list of patterns inside brackets.

(input: syn::parse::ParseStream)

Source from the content-addressed store, hash-verified

42
43/// Parse a comma-separated list of patterns inside brackets.
44fn 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}

Callers 1

parseMethod · 0.85

Calls 3

is_emptyMethod · 0.80
pushMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected