1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Enable and fix some more clippy lints

This commit is contained in:
Emil Ernerfeldt
2022-12-05 09:29:59 +01:00
parent e1f348e4b2
commit 5093b67e9b
28 changed files with 44 additions and 44 deletions

View File

@@ -43,7 +43,7 @@ impl ImageData {
// ----------------------------------------------------------------------------
/// A 2D RGBA color image in RAM.
#[derive(Clone, Default, PartialEq)]
#[derive(Clone, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct ColorImage {
/// width, height.

View File

@@ -5,7 +5,7 @@ use emath::*;
///
/// Should be friendly to send to GPU as is.
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
pub struct Vertex {
@@ -23,7 +23,7 @@ pub struct Vertex {
}
/// Textured triangles in two dimensions.
#[derive(Clone, Debug, Default, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Mesh {
/// Draw as triangles (i.e. the length is always multiple of three).

View File

@@ -30,7 +30,7 @@ impl Shadow {
}
}
/// Used for widnows in dark mode.
/// Used for egui windows in dark mode.
pub fn big_dark() -> Self {
Self {
extrusion: 32.0,
@@ -38,7 +38,7 @@ impl Shadow {
}
}
/// Used for widnows in light mode.
/// Used for egui windows in light mode.
pub fn big_light() -> Self {
Self {
extrusion: 32.0,
@@ -46,7 +46,7 @@ impl Shadow {
}
}
pub fn tessellate(&self, rect: emath::Rect, rounding: impl Into<Rounding>) -> Mesh {
pub fn tessellate(&self, rect: Rect, rounding: impl Into<Rounding>) -> Mesh {
// tessellator.clip_rect = clip_rect; // TODO(emilk): culling
let Self { extrusion, color } = *self;

View File

@@ -586,7 +586,7 @@ pub mod path {
// ----------------------------------------------------------------------------
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum PathType {
Open,
Closed,

View File

@@ -66,7 +66,7 @@ impl std::ops::SubAssign<usize> for CCursor {
}
/// Row Cursor
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct RCursor {
/// 0 is first row, and so on.

View File

@@ -8,7 +8,7 @@ use std::sync::Arc;
// ----------------------------------------------------------------------------
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct UvRect {
/// X/Y offset for nice rendering (unit: points).

View File

@@ -351,7 +351,7 @@ pub struct Galley {
pub pixels_per_point: f32,
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Row {
/// One for each `char`.
@@ -374,7 +374,7 @@ pub struct Row {
}
/// The tessellated output of a row.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct RowVisuals {
/// The tessellated text, using non-normalized (texel) UV coordinates.
@@ -400,7 +400,7 @@ impl Default for RowVisuals {
}
}
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Glyph {
/// The character this glyph represents.

View File

@@ -117,7 +117,7 @@ impl TextureManager {
}
/// Meta-data about an allocated texture.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TextureMeta {
/// A human-readable name useful for debugging.
pub name: String,