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:
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -31,7 +31,7 @@ pub struct ViewportState {
|
||||
pub visible: bool,
|
||||
pub immediate: bool,
|
||||
pub title: String,
|
||||
pub children: Vec<Arc<RwLock<ViewportState>>>,
|
||||
pub children: Vec<Arc<RwLock<Self>>>,
|
||||
}
|
||||
|
||||
impl ViewportState {
|
||||
|
||||
Reference in New Issue
Block a user