mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
enforce and fix a bunch of clippy issues
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{layout::Direction, *};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, serde_derive::Deserialize, serde_derive::Serialize)]
|
||||
#[serde(default)]
|
||||
pub(crate) struct State {
|
||||
open: bool,
|
||||
@@ -136,8 +136,8 @@ impl CollapsingHeader {
|
||||
}
|
||||
|
||||
fn paint_icon(region: &mut Region, state: &State, interact: &InteractInfo) {
|
||||
let stroke_color = region.style().interact_stroke_color(&interact);
|
||||
let stroke_width = region.style().interact_stroke_width(&interact);
|
||||
let stroke_color = region.style().interact_stroke_color(interact);
|
||||
let stroke_width = region.style().interact_stroke_width(interact);
|
||||
|
||||
let (mut small_icon_rect, _) = region.style().icon_rectangles(interact.rect);
|
||||
small_icon_rect.set_center(pos2(
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{fmt::Debug, hash::Hash, sync::Arc};
|
||||
|
||||
use crate::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, serde_derive::Deserialize, serde_derive::Serialize)]
|
||||
pub(crate) struct State {
|
||||
/// Last known pos
|
||||
pub pos: Pos2,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#![allow(unused_variables)] // TODO
|
||||
|
||||
use crate::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, serde_derive::Deserialize, serde_derive::Serialize)]
|
||||
pub(crate) struct State {
|
||||
size: Vec2,
|
||||
}
|
||||
@@ -142,7 +143,7 @@ impl Resize {
|
||||
self.max_size = self.max_size.max(self.min_size);
|
||||
|
||||
let (is_new, mut state) = match region.memory().resize.get(&id) {
|
||||
Some(state) => (false, state.clone()),
|
||||
Some(state) => (false, *state),
|
||||
None => {
|
||||
let default_size = self.default_size.clamp(self.min_size..=self.max_size);
|
||||
(true, State { size: default_size })
|
||||
@@ -234,8 +235,8 @@ impl Resize {
|
||||
}
|
||||
|
||||
fn paint_resize_corner(region: &mut Region, interact: &InteractInfo) {
|
||||
let color = region.style().interact_stroke_color(&interact);
|
||||
let width = region.style().interact_stroke_width(&interact);
|
||||
let color = region.style().interact_stroke_color(interact);
|
||||
let width = region.style().interact_stroke_width(interact);
|
||||
|
||||
let corner = interact.rect.right_bottom().round(); // TODO: round to pixels
|
||||
let mut w = 2.0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Default, serde_derive::Deserialize, serde_derive::Serialize)]
|
||||
#[serde(default)]
|
||||
pub(crate) struct State {
|
||||
/// Positive offset means scrolling down/right
|
||||
|
||||
Reference in New Issue
Block a user