mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Remove unnecessary replace_in_variable
(#11424)
# Description `Expression::replace_in_variable` is only called in one place, and it is called with `new_var_id` = `IN_VARIABLE_ID`. So, it ends up doing nothing. E.g., adding `debug_assert_eq!(new_var_id, IN_VARIABLE_ID)` in `replace_in_variable` does not trigger any panic. # User-Facing Changes Breaking change for `nu_protocol`.
This commit is contained in:
@ -6086,11 +6086,8 @@ fn wrap_expr_with_collect(working_set: &mut StateWorkingSet, expr: &Expression)
|
||||
default_value: None,
|
||||
});
|
||||
|
||||
let mut expr = expr.clone();
|
||||
expr.replace_in_variable(working_set, var_id);
|
||||
|
||||
let block = Block {
|
||||
pipelines: vec![Pipeline::from_vec(vec![expr])],
|
||||
pipelines: vec![Pipeline::from_vec(vec![expr.clone()])],
|
||||
signature: Box::new(signature),
|
||||
..Default::default()
|
||||
};
|
||||
|
Reference in New Issue
Block a user