Skip to content

Commit 375a0ff

Browse files
Use itertools
1 parent b8437f7 commit 375a0ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/hir_expand/src/builtin_macro.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,16 @@ fn assert_expand(
184184
let args = parse_exprs_with_sep(tt, ',');
185185
let expanded = match &*args {
186186
[cond, panic_args @ ..] => {
187-
let cond = cond.clone();
188-
let panic_args = panic_args.iter().cloned().intersperse(tt::Subtree {
187+
let comma = tt::Subtree {
189188
delimiter: None,
190189
token_trees: vec![tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct {
191190
char: ',',
192191
spacing: tt::Spacing::Alone,
193192
id: tt::TokenId::unspecified(),
194193
}))],
195-
});
194+
};
195+
let cond = cond.clone();
196+
let panic_args = itertools::Itertools::intersperse(panic_args.iter().cloned(), comma);
196197
quote! {{
197198
if !#cond {
198199
#krate::panic!(##panic_args);

0 commit comments

Comments
 (0)