Improve parameter inference for blocks (#2708)

This commit is contained in:
Jonathan Turner
2020-10-28 07:47:11 +13:00
committed by GitHub
parent ee76523507
commit 8229af7591
3 changed files with 21 additions and 21 deletions

View File

@ -82,17 +82,16 @@ pub async fn process_row(
// When we process a row, we need to know whether the block wants to have the contents of the row as
// a parameter to the block (so it gets assigned to a variable that can be used inside the block) or
// if it wants the contents as as an input stream
let params = block.params();
let input_stream = if !params.is_empty() {
let input_stream = if !block.params.is_empty() {
InputStream::empty()
} else {
once(async { Ok(input_clone) }).to_input_stream()
};
let scope = if !params.is_empty() {
let scope = if !block.params.is_empty() {
// FIXME: add check for more than parameter, once that's supported
Scope::append_var(scope, params[0].clone(), input)
Scope::append_var(scope, block.params[0].clone(), input)
} else {
scope
};