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

Function between

impl/src/fmt.rs:299–323  ·  view source on GitHub ↗
(begin: ParseStream<'a>, end: ParseStream<'a>)

Source from the content-addressed store, hash-verified

297}
298
299fn between<'a>(begin: ParseStream<'a>, end: ParseStream<'a>) -> TokenStream {
300 let end = end.cursor();
301 let mut cursor = begin.cursor();
302 let mut tokens = TokenStream::new();
303
304 while cursor < end {
305 let (tt, next) = cursor.token_tree().unwrap();
306
307 if end < next {
308 if let Some((inside, _span, _after)) = cursor.group(Delimiter::None) {
309 cursor = inside;
310 continue;
311 }
312 if tokens.is_empty() {
313 tokens.extend(iter::once(tt));
314 }
315 break;
316 }
317
318 tokens.extend(iter::once(tt));
319 cursor = next;
320 }
321
322 tokens
323}

Callers 1

try_explicit_named_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected