1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -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

View File

@@ -451,7 +451,7 @@ enum Action {
#[derive(Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
struct Tree(Vec<Tree>);
struct Tree(Vec<Self>);
impl Tree {
pub fn demo() -> Self {

View File

@@ -30,7 +30,7 @@ pub enum Shape {
/// Recursively nest more shapes - sometimes a convenience to be able to do.
/// For performance reasons it is better to avoid it.
Vec(Vec<Shape>),
Vec(Vec<Self>),
/// Circle with optional outline and fill.
Circle(CircleShape),