1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

clippy +nightly fix (#7723)

This commit is contained in:
Emil Ernerfeldt
2025-11-17 05:10:43 +01:00
committed by GitHub
parent 01770be13e
commit dc0acd2dd1
7 changed files with 11 additions and 13 deletions

View File

@@ -161,14 +161,13 @@ impl MenuState {
if state.last_visible_pass + 1 < pass_nr {
state.open_item = None;
}
if let Some(item) = state.open_item {
if data
if let Some(item) = state.open_item
&& data
.get_temp(item.with(Self::ID))
.is_none_or(|item: Self| item.last_visible_pass + 1 < pass_nr)
{
// If the open item wasn't shown for at least a frame, reset the open item
state.open_item = None;
}
{
// If the open item wasn't shown for at least a frame, reset the open item
state.open_item = None;
}
let r = f(&mut state);
data.insert_temp(state_id, state);

View File

@@ -1272,8 +1272,7 @@ impl Areas {
pub fn top_layer_id(&self, order: Order) -> Option<LayerId> {
self.order
.iter()
.filter(|layer| layer.order == order && !self.is_sublayer(layer))
.next_back()
.rfind(|layer| layer.order == order && !self.is_sublayer(layer))
.copied()
}

View File

@@ -634,7 +634,7 @@ impl SubMenu {
/// Usually you don't need to use it directly.
pub struct MenuState {
/// The opened sub-menu and its [`Id`]
sub_menu: Option<(Id, Arc<RwLock<MenuState>>)>,
sub_menu: Option<(Id, Arc<RwLock<Self>>)>,
/// Bounding box of this menu (without the sub-menu),
/// including the frame and everything.

View File

@@ -209,7 +209,7 @@ pub struct UiStack {
pub layout_direction: Direction,
pub min_rect: Rect,
pub max_rect: Rect,
pub parent: Option<Arc<UiStack>>,
pub parent: Option<Arc<Self>>,
}
// these methods act on this specific node