Stop boxing ParseExecutionContext

This wasn't necessary - probably a holdover from using unique_ptr in C++.
This commit is contained in:
ridiculousfish 2023-11-18 12:44:21 -08:00
parent 89376d5fd0
commit f0eaa516c0
2 changed files with 4 additions and 7 deletions

View File

@ -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);

View File

@ -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 @@ impl Parser {
result
}
fn execution_context(&self) -> Ref<'_, Option<Box<ParseExecutionContext>>> {
fn execution_context(&self) -> Ref<'_, Option<ParseExecutionContext>> {
self.execution_context.borrow()
}
@ -579,10 +579,7 @@ impl Parser {
))
}
},
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.