mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-27 13:18:56 +08:00
Stop boxing ParseExecutionContext
This wasn't necessary - probably a holdover from using unique_ptr in C++.
This commit is contained in:
parent
89376d5fd0
commit
f0eaa516c0
@ -101,7 +101,7 @@ struct CachedLineno {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ParseExecutionContext {
|
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.pstree.swap(&right.pstree);
|
||||||
left.cancel_signal.swap(&right.cancel_signal);
|
left.cancel_signal.swap(&right.cancel_signal);
|
||||||
left.executing_job_node.swap(&right.executing_job_node);
|
left.executing_job_node.swap(&right.executing_job_node);
|
||||||
|
@ -308,7 +308,7 @@ pub struct Parser {
|
|||||||
base: SharedFromThisBase<Parser>,
|
base: SharedFromThisBase<Parser>,
|
||||||
|
|
||||||
/// The current execution context.
|
/// The current execution context.
|
||||||
execution_context: RefCell<Option<Box<ParseExecutionContext>>>,
|
execution_context: RefCell<Option<ParseExecutionContext>>,
|
||||||
|
|
||||||
/// The jobs associated with this parser.
|
/// The jobs associated with this parser.
|
||||||
job_list: RefCell<JobList>,
|
job_list: RefCell<JobList>,
|
||||||
@ -381,7 +381,7 @@ impl Parser {
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execution_context(&self) -> Ref<'_, Option<Box<ParseExecutionContext>>> {
|
fn execution_context(&self) -> Ref<'_, Option<ParseExecutionContext>> {
|
||||||
self.execution_context.borrow()
|
self.execution_context.borrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,10 +579,7 @@ impl Parser {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(Box::new(ParseExecutionContext::new(
|
Some(ParseExecutionContext::new(ps.clone(), block_io.clone())),
|
||||||
ps.clone(),
|
|
||||||
block_io.clone(),
|
|
||||||
))),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check the exec count so we know if anything got executed.
|
// Check the exec count so we know if anything got executed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user