Skip to content

Commit 2422542

Browse files
committed
Remove a Arc clone in menu code
1 parent 6db223b commit 2422542

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

egui/src/menu.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ pub(crate) fn submenu_button<R>(
110110
}
111111

112112
/// wrapper for the contents of every menu.
113-
#[allow(clippy::needless_pass_by_value)]
114113
pub(crate) fn menu_ui<'c, R>(
115114
ctx: &CtxRef,
116115
menu_id: impl std::hash::Hash,
117-
menu_state_arc: Arc<RwLock<MenuState>>,
116+
menu_state_arc: &Arc<RwLock<MenuState>>,
118117
mut style: Style,
119118
add_contents: impl FnOnce(&mut Ui) -> R + 'c,
120119
) -> InnerResponse<R> {
@@ -516,8 +515,7 @@ impl MenuState {
516515
},
517516
..Default::default()
518517
};
519-
let menu_state_arc = menu_state.clone();
520-
crate::menu::menu_ui(ctx, id, menu_state_arc, style, add_contents)
518+
crate::menu::menu_ui(ctx, id, menu_state, style, add_contents)
521519
}
522520
fn show_submenu<R>(
523521
&mut self,

0 commit comments

Comments
 (0)