mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 15:20:05 -04:00
Fix some minor clippy lints from the future
This commit is contained in:
@@ -765,7 +765,7 @@ impl Layout {
|
||||
|
||||
/// Move to the next row in a wrapping layout.
|
||||
/// Otherwise does nothing.
|
||||
pub(crate) fn end_row(&mut self, region: &mut Region, spacing: Vec2) {
|
||||
pub(crate) fn end_row(&self, region: &mut Region, spacing: Vec2) {
|
||||
if self.main_wrap {
|
||||
match self.main_dir {
|
||||
Direction::LeftToRight => {
|
||||
@@ -788,7 +788,7 @@ impl Layout {
|
||||
}
|
||||
|
||||
/// Set row height in horizontal wrapping layout.
|
||||
pub(crate) fn set_row_height(&mut self, region: &mut Region, height: f32) {
|
||||
pub(crate) fn set_row_height(&self, region: &mut Region, height: f32) {
|
||||
if self.main_wrap && self.is_horizontal() {
|
||||
region.cursor.max.y = region.cursor.min.y + height;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ impl MenuRoot {
|
||||
}
|
||||
|
||||
pub fn show<R>(
|
||||
&mut self,
|
||||
&self,
|
||||
button: &Response,
|
||||
add_contents: impl FnOnce(&mut Ui) -> R,
|
||||
) -> (MenuResponse, Option<InnerResponse<R>>) {
|
||||
@@ -759,7 +759,7 @@ impl MenuState {
|
||||
self.sub_menu.as_ref().map(|(_, sub)| sub)
|
||||
}
|
||||
|
||||
fn submenu(&mut self, id: Id) -> Option<&Arc<RwLock<Self>>> {
|
||||
fn submenu(&self, id: Id) -> Option<&Arc<RwLock<Self>>> {
|
||||
self.sub_menu
|
||||
.as_ref()
|
||||
.and_then(|(k, sub)| if id == *k { Some(sub) } else { None })
|
||||
|
||||
@@ -98,7 +98,7 @@ impl TextEditState {
|
||||
}
|
||||
|
||||
#[deprecated = "Use `self.cursor.range` instead"]
|
||||
pub fn cursor_range(&mut self, galley: &Galley) -> Option<CursorRange> {
|
||||
pub fn cursor_range(&self, galley: &Galley) -> Option<CursorRange> {
|
||||
self.cursor.range(galley)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user