MCPcopy Create free account
hub / github.com/RustCrypto/utils / parse

Method parse

ctutils/checkct/checkct_macros/src/lib.rs:14–34  ·  view source on GitHub ↗
(input: ParseStream)

Source from the content-addressed store, hash-verified

12
13impl Parse for AttributeArgs {
14 fn parse(input: ParseStream) -> Result<Self> {
15 if input.is_empty() {
16 return Ok(Self {
17 descriptor_link_section: None,
18 });
19 }
20
21 let arg_name: Ident = input.parse()?;
22 if arg_name != "descriptor_link_section" {
23 return Err(Error::new(
24 arg_name.span(),
25 "expected `descriptor_link_section`",
26 ));
27 }
28 input.parse::<Token![=]>()?;
29 let descriptor_link_section: LitStr = input.parse()?;
30
31 Ok(Self {
32 descriptor_link_section: Some(descriptor_link_section.value()),
33 })
34 }
35}
36
37#[proc_macro_attribute]

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected