MCPcopy Create free account
hub / github.com/dtolnay/thiserror / fallback_explicit_named_args

Function fallback_explicit_named_args

impl/src/fmt.rs:231–253  ·  view source on GitHub ↗
(input: ParseStream)

Source from the content-addressed store, hash-verified

229}
230
231fn fallback_explicit_named_args(input: ParseStream) -> Result<FmtArguments> {
232 let mut args = FmtArguments {
233 named: BTreeSet::new(),
234 first_unnamed: None,
235 };
236
237 while !input.is_empty() {
238 if input.peek(Token![,])
239 && input.peek2(Ident::peek_any)
240 && input.peek3(Token![=])
241 && !input.peek3(Token![==])
242 {
243 input.parse::<Token![,]>()?;
244 let ident: IdentUnraw = input.parse()?;
245 input.parse::<Token![=]>()?;
246 args.named.insert(ident);
247 } else {
248 input.parse::<TokenTree>()?;
249 }
250 }
251
252 Ok(args)
253}
254
255fn is_syn_full() -> bool {
256 // Expr::Block contains syn::Block which contains Vec<syn::Stmt>. In the

Callers 1

explicit_named_argsFunction · 0.85

Calls 2

parseMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected