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

clippy fixes

This commit is contained in:
Emil Ernerfeldt
2022-01-16 22:13:22 +01:00
parent ab77099781
commit 39dd6d7644
5 changed files with 19 additions and 56 deletions

View File

@@ -237,19 +237,11 @@ impl Widget for &mut MarkerDemo {
}
}
#[derive(PartialEq)]
#[derive(Default, PartialEq)]
struct LegendDemo {
config: Legend,
}
impl Default for LegendDemo {
fn default() -> Self {
Self {
config: Legend::default(),
}
}
}
impl LegendDemo {
fn line_with_slope(slope: f64) -> Line {
Line::new(Values::from_explicit_callback(move |x| slope * x, .., 100))
@@ -381,15 +373,9 @@ impl Widget for &mut ItemsDemo {
}
}
#[derive(PartialEq)]
#[derive(Default, PartialEq)]
struct InteractionDemo {}
impl Default for InteractionDemo {
fn default() -> Self {
Self {}
}
}
impl Widget for &mut InteractionDemo {
fn ui(self, ui: &mut Ui) -> Response {
let plot = Plot::new("interaction_demo").height(300.0);

View File

@@ -253,17 +253,11 @@ impl super::View for ScrollTo {
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "serde", serde(default))]
#[derive(PartialEq)]
#[derive(Default, PartialEq)]
struct ScrollStickTo {
n_items: usize,
}
impl Default for ScrollStickTo {
fn default() -> Self {
Self { n_items: 0 }
}
}
impl super::View for ScrollStickTo {
fn ui(&mut self, ui: &mut Ui) {
ui.label("Rows enter from the bottom, we want the scroll handle to start and stay at bottom unless moved");