From 409f1480f5e8d89d1b1d3dc958d1db49b1bc668f Mon Sep 17 00:00:00 2001 From: Yethal Date: Tue, 19 Apr 2022 00:02:58 +0200 Subject: [PATCH] allow par-each to receive $in (#5229) Co-authored-by: Yethal --- crates/nu-command/src/filters/par_each.rs | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/nu-command/src/filters/par_each.rs b/crates/nu-command/src/filters/par_each.rs index 29c60f6de3..b822c5af15 100644 --- a/crates/nu-command/src/filters/par_each.rs +++ b/crates/nu-command/src/filters/par_each.rs @@ -92,13 +92,13 @@ impl Command for ParEach { val: idx as i64, span, }, - x, + x.clone(), ], span, }, ); } else { - stack.add_var(*var_id, x); + stack.add_var(*var_id, x.clone()); } } } @@ -107,7 +107,7 @@ impl Command for ParEach { &engine_state, &mut stack, block, - PipelineData::new(span), + x.into_pipeline_data(), redirect_stdout, redirect_stderr, ) { @@ -140,13 +140,13 @@ impl Command for ParEach { val: idx as i64, span, }, - x, + x.clone(), ], span, }, ); } else { - stack.add_var(*var_id, x); + stack.add_var(*var_id, x.clone()); } } } @@ -155,7 +155,7 @@ impl Command for ParEach { &engine_state, &mut stack, block, - PipelineData::new(span), + x.into_pipeline_data(), redirect_stdout, redirect_stderr, ) { @@ -187,13 +187,13 @@ impl Command for ParEach { val: idx as i64, span, }, - x, + x.clone(), ], span, }, ); } else { - stack.add_var(*var_id, x); + stack.add_var(*var_id, x.clone()); } } } @@ -202,7 +202,7 @@ impl Command for ParEach { &engine_state, &mut stack, block, - PipelineData::new(span), + x.into_pipeline_data(), redirect_stdout, redirect_stderr, ) { @@ -243,13 +243,13 @@ impl Command for ParEach { val: idx as i64, span, }, - x, + x.clone(), ], span, }, ); } else { - stack.add_var(*var_id, x); + stack.add_var(*var_id, x.clone()); } } } @@ -258,7 +258,7 @@ impl Command for ParEach { &engine_state, &mut stack, block, - PipelineData::new(span), + x.into_pipeline_data(), redirect_stdout, redirect_stderr, ) { @@ -275,7 +275,7 @@ impl Command for ParEach { if let Some(var) = block.signature.get_positional(0) { if let Some(var_id) = &var.var_id { - stack.add_var(*var_id, x); + stack.add_var(*var_id, x.clone()); } } @@ -283,7 +283,7 @@ impl Command for ParEach { &engine_state, &mut stack, block, - PipelineData::new(span), + x.into_pipeline_data(), redirect_stdout, redirect_stderr, )