WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit dc0acd2

Browse files
authored
clippy +nightly fix (#7723)
1 parent 01770be commit dc0acd2

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

crates/egui/src/containers/menu.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,13 @@ impl MenuState {
161161
if state.last_visible_pass + 1 < pass_nr {
162162
state.open_item = None;
163163
}
164-
if let Some(item) = state.open_item {
165-
if data
164+
if let Some(item) = state.open_item
165+
&& data
166166
.get_temp(item.with(Self::ID))
167167
.is_none_or(|item: Self| item.last_visible_pass + 1 < pass_nr)
168-
{
169-
// If the open item wasn't shown for at least a frame, reset the open item
170-
state.open_item = None;
171-
}
168+
{
169+
// If the open item wasn't shown for at least a frame, reset the open item
170+
state.open_item = None;
172171
}
173172
let r = f(&mut state);
174173
data.insert_temp(state_id, state);

crates/egui/src/memory/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,8 +1272,7 @@ impl Areas {
12721272
pub fn top_layer_id(&self, order: Order) -> Option<LayerId> {
12731273
self.order
12741274
.iter()
1275-
.filter(|layer| layer.order == order && !self.is_sublayer(layer))
1276-
.next_back()
1275+
.rfind(|layer| layer.order == order && !self.is_sublayer(layer))
12771276
.copied()
12781277
}
12791278

crates/egui/src/menu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ impl SubMenu {
634634
/// Usually you don't need to use it directly.
635635
pub struct MenuState {
636636
/// The opened sub-menu and its [`Id`]
637-
sub_menu: Option<(Id, Arc<RwLock<MenuState>>)>,
637+
sub_menu: Option<(Id, Arc<RwLock<Self>>)>,
638638

639639
/// Bounding box of this menu (without the sub-menu),
640640
/// including the frame and everything.

crates/egui/src/ui_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub struct UiStack {
209209
pub layout_direction: Direction,
210210
pub min_rect: Rect,
211211
pub max_rect: Rect,
212-
pub parent: Option<Arc<UiStack>>,
212+
pub parent: Option<Arc<Self>>,
213213
}
214214

215215
// these methods act on this specific node

crates/egui_demo_lib/src/demo/misc_demo_window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ enum Action {
451451

452452
#[derive(Clone, Default)]
453453
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
454-
struct Tree(Vec<Tree>);
454+
struct Tree(Vec<Self>);
455455

456456
impl Tree {
457457
pub fn demo() -> Self {

crates/epaint/src/shapes/shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub enum Shape {
3030

3131
/// Recursively nest more shapes - sometimes a convenience to be able to do.
3232
/// For performance reasons it is better to avoid it.
33-
Vec(Vec<Shape>),
33+
Vec(Vec<Self>),
3434

3535
/// Circle with optional outline and fill.
3636
Circle(CircleShape),

tests/test_viewports/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct ViewportState {
3131
pub visible: bool,
3232
pub immediate: bool,
3333
pub title: String,
34-
pub children: Vec<Arc<RwLock<ViewportState>>>,
34+
pub children: Vec<Arc<RwLock<Self>>>,
3535
}
3636

3737
impl ViewportState {

0 commit comments

Comments
 (0)