1
0
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:
Emil Ernerfeldt
2020-05-07 10:47:03 +02:00
parent 077cc3d8d1
commit 87e3aacf35
25 changed files with 90 additions and 67 deletions

View File

@@ -12,7 +12,7 @@ pub use {slider::*, text_edit::*};
// ----------------------------------------------------------------------------
/// Anything implementing Widget can be added to a Region with Region::add
/// Anything implementing Widget can be added to a Region with `Region::add`
pub trait Widget {
fn ui(self, region: &mut Region) -> GuiResponse;
}
@@ -28,7 +28,7 @@ pub struct Label {
impl Label {
pub fn new(text: impl Into<String>) -> Self {
Label {
Self {
text: text.into(),
multiline: true,
text_style: TextStyle::Body,
@@ -138,7 +138,7 @@ pub struct Button {
impl Button {
pub fn new(text: impl Into<String>) -> Self {
Button {
Self {
text: text.into(),
text_color: None,
}
@@ -257,7 +257,7 @@ pub struct RadioButton {
impl RadioButton {
pub fn new(checked: bool, text: impl Into<String>) -> Self {
RadioButton {
Self {
checked,
text: text.into(),
text_color: None,
@@ -328,8 +328,8 @@ pub struct Separator {
}
impl Separator {
pub fn new() -> Separator {
Separator {
pub fn new() -> Self {
Self {
line_width: 2.0,
min_length: 6.0,
extra: 0.0,