mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-26 07:41:15 -03:00
Stop boxing ParseExecutionContext
This wasn't necessary - probably a holdover from using unique_ptr in C++.
This commit is contained in:
@@ -101,7 +101,7 @@ struct CachedLineno {
|
||||
}
|
||||
|
||||
impl ParseExecutionContext {
|
||||
pub fn swap(left: &Self, right: Box<Self>) -> Box<Self> {
|
||||
pub fn swap(left: &Self, right: Self) -> Self {
|
||||
left.pstree.swap(&right.pstree);
|
||||
left.cancel_signal.swap(&right.cancel_signal);
|
||||
left.executing_job_node.swap(&right.executing_job_node);
|
||||
|
||||
@@ -308,7 +308,7 @@ pub struct Parser {
|
||||
base: SharedFromThisBase<Parser>,
|
||||
|
||||
/// The current execution context.
|
||||
execution_context: RefCell<Option<Box<ParseExecutionContext>>>,
|
||||
execution_context: RefCell<Option<ParseExecutionContext>>,
|
||||
|
||||
/// The jobs associated with this parser.
|
||||
job_list: RefCell<JobList>,
|
||||
@@ -381,7 +381,7 @@ pub fn new(variables: EnvStackRef, is_principal: bool) -> ParserRef {
|
||||
result
|
||||
}
|
||||
|
||||
fn execution_context(&self) -> Ref<'_, Option<Box<ParseExecutionContext>>> {
|
||||
fn execution_context(&self) -> Ref<'_, Option<ParseExecutionContext>> {
|
||||
self.execution_context.borrow()
|
||||
}
|
||||
|
||||
@@ -579,10 +579,7 @@ pub fn eval_node<T: Node>(
|
||||
))
|
||||
}
|
||||
},
|
||||
Some(Box::new(ParseExecutionContext::new(
|
||||
ps.clone(),
|
||||
block_io.clone(),
|
||||
))),
|
||||
Some(ParseExecutionContext::new(ps.clone(), block_io.clone())),
|
||||
);
|
||||
|
||||
// Check the exec count so we know if anything got executed.
|
||||
|
||||
Reference in New Issue
Block a user