mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
Remove an Option from the parsed source ref in parse_execution
This was never None.
This commit is contained in:
parent
3aa12c1be9
commit
ad1ea94405
|
@ -76,9 +76,9 @@ pub enum EndExecutionReason {
|
|||
error,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct ExecutionContext {
|
||||
pstree: RefCell<Option<ParsedSourceRef>>,
|
||||
// The parsed source and its AST.
|
||||
pstree: RefCell<ParsedSourceRef>,
|
||||
|
||||
// If set, one of our processes received a cancellation signal (INT or QUIT) so we are
|
||||
// unwinding.
|
||||
|
@ -138,7 +138,7 @@ impl<'a> ExecutionContext {
|
|||
/// The execution context may access the parser and parent job group (if any) through ctx.
|
||||
pub fn new(pstree: ParsedSourceRef, block_io: IoChain) -> Self {
|
||||
Self {
|
||||
pstree: RefCell::new(Some(pstree)),
|
||||
pstree: RefCell::new(pstree),
|
||||
cancel_signal: RefCell::default(),
|
||||
executing_job_node: RefCell::default(),
|
||||
cached_lineno: RefCell::default(),
|
||||
|
@ -148,7 +148,7 @@ impl<'a> ExecutionContext {
|
|||
|
||||
pub fn pstree(&self) -> ParsedSourceRef {
|
||||
// todo!("don't clone but expose a Ref<'_, ParsedSourceRef> or similar")
|
||||
self.pstree.borrow().as_ref().unwrap().clone()
|
||||
ParsedSourceRef::clone(&self.pstree.borrow())
|
||||
}
|
||||
|
||||
/// Returns the current line number, indexed from 1. Updates cached line ranges.
|
||||
|
|
Loading…
Reference in New Issue
Block a user