mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +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>(
|
||||
&mut self,
|
||||
var_assignments: impl IntoIterator<Item = &'a wstr>,
|
||||
) -> Option<ScopeGuard<(), impl FnOnce(&mut ())>> {
|
||||
) -> Option<ScopeGuard<(), impl FnOnce(&mut ()) + 'ctx>> {
|
||||
if !self.ctx.has_parser() {
|
||||
return None;
|
||||
}
|
||||
|
@ -1923,8 +1923,8 @@ impl<'ctx> Completer<'ctx> {
|
|||
}
|
||||
}
|
||||
|
||||
let parser_ref = self.ctx.parser().shared();
|
||||
Some(ScopeGuard::new((), move |_| parser_ref.pop_block(block)))
|
||||
let parser = self.ctx.parser();
|
||||
Some(ScopeGuard::new((), move |_| parser.pop_block(block)))
|
||||
}
|
||||
|
||||
/// Complete a command by invoking user-specified completions.
|
||||
|
|
Loading…
Reference in a new issue