Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maldus512 committed May 30, 2022
1 parent 8aaa636 commit b5f1140
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
15 changes: 5 additions & 10 deletions examples/layout/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ fn main() {
);
}

#[derive(Default)]
struct MyApp {}

impl Default for MyApp {
fn default() -> Self {
Self {}
}
}

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
#[derive(Hash)]
Expand Down Expand Up @@ -95,7 +90,7 @@ impl eframe::App for MyApp {
ui.with_layout(egui::Layout::top_down(egui::Align::Center), |ui| {
for i in 0..4 {
if ui.button(format!("Centered button {}", i)).clicked() {
println!("Clicked {}!", i)
println!("Clicked {}!", i);
};
}
});
Expand All @@ -108,7 +103,7 @@ impl eframe::App for MyApp {
.button(format!("Centered&justified button {}", i))
.clicked()
{
println!("Clicked {}!", i)
println!("Clicked {}!", i);
};
}
},
Expand All @@ -120,7 +115,7 @@ impl eframe::App for MyApp {
for i in 0..4 {
if ui.button(format!("Right&justified button {}", i)).clicked()
{
println!("Clicked {}!", i)
println!("Clicked {}!", i);
};
}
},
Expand All @@ -129,7 +124,7 @@ impl eframe::App for MyApp {
ui.with_layout(egui::Layout::top_down(egui::Align::LEFT), |ui| {
for i in 0..4 {
if ui.button(format!("Left button {}", i)).clicked() {
println!("Clicked {}!", i)
println!("Clicked {}!", i);
};
}
});
Expand Down
4 changes: 2 additions & 2 deletions examples/selection/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl eframe::App for MyApp {
.show_ui(ui, |ui| {
for option in STRING_OPTIONS {
// Selectable values can be anything: enums, strings or integers - as long as they can be compared and have a text repersentation
ui.selectable_value(&mut self.string_option, option.into(), option.clone());
ui.selectable_value(&mut self.string_option, option.into(), option);
}
});

Expand All @@ -101,7 +101,7 @@ impl eframe::App for MyApp {
for option in STRING_OPTIONS {
ui.add(egui::SelectableLabel::new(
self.string_option == option,
option.clone(),
option,
));
}
});
Expand Down

0 comments on commit b5f1140

Please sign in to comment.