mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
# Description @sholderbach left a very helpful review and this just implements the suggestions he made. Didn't notice any difference in performance, but there could potentially be for a long running Nushell session or one that loads a lot of stuff. I also caught a bug where nu-protocol won't build without `plugin` because of the previous conditional import. Oops. Fixed. # User-Facing Changes `blocks` and `modules` type in `EngineState` changed again. Shouldn't affect plugins or anything else though really # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting --------- Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{Argument, Expr, ExternalArgument, RecordItem};
|
||||
use super::{Argument, Block, Expr, ExternalArgument, RecordItem};
|
||||
use crate::ast::ImportPattern;
|
||||
use crate::DeclId;
|
||||
use crate::{engine::StateWorkingSet, BlockId, Signature, Span, Type, VarId, IN_VARIABLE_ID};
|
||||
@ -327,7 +327,8 @@ impl Expression {
|
||||
expr.replace_span(working_set, replaced, new_span);
|
||||
}
|
||||
Expr::Block(block_id) => {
|
||||
let mut block = (**working_set.get_block(*block_id)).clone();
|
||||
// We are cloning the Block itself, rather than the Arc around it.
|
||||
let mut block = Block::clone(working_set.get_block(*block_id));
|
||||
|
||||
for pipeline in block.pipelines.iter_mut() {
|
||||
for element in pipeline.elements.iter_mut() {
|
||||
|
Reference in New Issue
Block a user