optimize clone semantics, enshort namespaces

This commit is contained in:
yggverse 2025-01-11 20:56:53 +02:00
parent fd9f69a9f0
commit eabd16aaf7
20 changed files with 134 additions and 114 deletions

View file

@ -2,8 +2,7 @@ mod widget;
use widget::Widget;
use crate::app::browser::action::Action as BrowserAction;
use crate::app::browser::window::action::Action as WindowAction;
use super::{BrowserAction, Profile, WindowAction};
use gtk::{
gio::{self},
prelude::ActionExt,
@ -16,8 +15,8 @@ pub struct Menu {
#[rustfmt::skip] // @TODO template builder?
impl Menu {
pub fn new(
browser_action: Rc<BrowserAction>,
window_action: Rc<WindowAction>,
(browser_action, window_action): (&Rc<BrowserAction>, &Rc<WindowAction>),
_profile: &Rc<Profile>,
) -> Self {
// Main
let main = gio::Menu::new();

View file

@ -14,7 +14,7 @@ pub struct Tab {
impl Tab {
// Construct
pub fn new(window_action: Rc<WindowAction>, view: &TabView) -> Self {
pub fn new(window_action: &Rc<WindowAction>, view: &TabView) -> Self {
Self {
widget: Rc::new(Widget::new(
view,

View file

@ -11,9 +11,9 @@ pub struct Append {
impl Append {
// Construct
pub fn new(window_action: Rc<WindowAction>) -> Self {
pub fn new(window_action: &Rc<WindowAction>) -> Self {
Self {
widget: Rc::new(Widget::new(window_action)),
widget: Rc::new(Widget::new(window_action.clone())),
}
}
}