mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Start removing calls to Parser::shared()
Parser::shared() gets an Rc to a Parser, but we can do without it. Let's aim to get rid of the cyclic ref.
This commit is contained in:
parent
245ee466cb
commit
832ed31687
1 changed files with 3 additions and 3 deletions
|
@ -1868,7 +1868,7 @@ impl<'ctx> Completer<'ctx> {
|
||||||
fn apply_var_assignments<'a>(
|
fn apply_var_assignments<'a>(
|
||||||
&mut self,
|
&mut self,
|
||||||
var_assignments: impl IntoIterator<Item = &'a wstr>,
|
var_assignments: impl IntoIterator<Item = &'a wstr>,
|
||||||
) -> Option<ScopeGuard<(), impl FnOnce(&mut ())>> {
|
) -> Option<ScopeGuard<(), impl FnOnce(&mut ()) + 'ctx>> {
|
||||||
if !self.ctx.has_parser() {
|
if !self.ctx.has_parser() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
@ -1923,8 +1923,8 @@ impl<'ctx> Completer<'ctx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let parser_ref = self.ctx.parser().shared();
|
let parser = self.ctx.parser();
|
||||||
Some(ScopeGuard::new((), move |_| parser_ref.pop_block(block)))
|
Some(ScopeGuard::new((), move |_| parser.pop_block(block)))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Complete a command by invoking user-specified completions.
|
/// Complete a command by invoking user-specified completions.
|
||||||
|
|
Loading…
Reference in a new issue