Remove double ref
This commit is contained in:
parent
c8b0c46d0e
commit
22994c97f6
1 changed files with 6 additions and 14 deletions
|
@ -736,44 +736,36 @@ impl GuiHandler {
|
||||||
Ok(false)
|
Ok(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn decline_topgui(&self, gui_handler: &mut GuiHandler) -> Result<bool> {
|
pub fn decline_topgui(&mut self) -> Result<bool> {
|
||||||
// workaround for unwanted borrowing behaviour inside decline function
|
// workaround for unwanted borrowing behaviour inside decline function
|
||||||
let opt_topgui = self.top_ui.as_ref().cloned();
|
let opt_topgui = self.top_ui.as_ref().cloned();
|
||||||
|
|
||||||
if let Some(topgui) = opt_topgui {
|
if let Some(topgui) = opt_topgui {
|
||||||
topgui.decline(gui_handler)?;
|
topgui.decline(self)?;
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(false)
|
Ok(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn next_tab_topgui(
|
pub fn next_tab_topgui(&mut self, second_level: bool) -> Result<bool> {
|
||||||
&self,
|
|
||||||
gui_handler: &mut GuiHandler,
|
|
||||||
second_level: bool,
|
|
||||||
) -> Result<bool> {
|
|
||||||
// workaround for unwanted borrowing behaviour inside decline function
|
// workaround for unwanted borrowing behaviour inside decline function
|
||||||
let opt_topgui = self.top_ui.as_ref().cloned();
|
let opt_topgui = self.top_ui.as_ref().cloned();
|
||||||
|
|
||||||
if let Some(topgui) = opt_topgui {
|
if let Some(topgui) = opt_topgui {
|
||||||
topgui.next_tab(gui_handler, second_level)?;
|
topgui.next_tab(self, second_level)?;
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(false)
|
Ok(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn previous_tab_topgui(
|
pub fn previous_tab_topgui(&mut self, second_level: bool) -> Result<bool> {
|
||||||
&self,
|
|
||||||
gui_handler: &mut GuiHandler,
|
|
||||||
second_level: bool,
|
|
||||||
) -> Result<bool> {
|
|
||||||
// workaround for unwanted borrowing behaviour inside decline function
|
// workaround for unwanted borrowing behaviour inside decline function
|
||||||
let opt_topgui = self.top_ui.as_ref().cloned();
|
let opt_topgui = self.top_ui.as_ref().cloned();
|
||||||
|
|
||||||
if let Some(topgui) = opt_topgui {
|
if let Some(topgui) = opt_topgui {
|
||||||
topgui.previous_tab(gui_handler, second_level)?;
|
topgui.previous_tab(self, second_level)?;
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue