File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -305,10 +305,15 @@ async fn prompt_template(
305
305
variant : & TemplateVariantInfo ,
306
306
tags : & [ String ] ,
307
307
) -> anyhow:: Result < Option < Template > > {
308
- let mut templates = match list_or_install_templates ( template_manager, tags) . await ? {
308
+ let templates = match list_or_install_templates ( template_manager, tags) . await ? {
309
309
Some ( t) => t,
310
310
None => return Ok ( None ) ,
311
311
} ;
312
+ let mut templates = templates
313
+ . into_iter ( )
314
+ . filter ( |t| t. supports_variant ( variant) )
315
+ . collect :: < Vec < _ > > ( ) ;
316
+
312
317
if templates. is_empty ( ) {
313
318
if tags. len ( ) == 1 {
314
319
bail ! ( "No templates matched '{}'" , tags[ 0 ] ) ;
@@ -319,7 +324,6 @@ async fn prompt_template(
319
324
320
325
let opts = templates
321
326
. iter ( )
322
- . filter ( |t| t. supports_variant ( variant) )
323
327
. map ( |t| format ! ( "{} ({})" , t. id( ) , t. description_or_empty( ) ) )
324
328
. collect :: < Vec < _ > > ( ) ;
325
329
let noun = variant. prompt_noun ( ) ;
You can’t perform that action at this time.
0 commit comments