[clippy] fix all clippy issues

This commit is contained in:
Emil Ernerfeldt
2020-07-30 12:30:20 +02:00
parent eb713ac514
commit df2cba41ff
5 changed files with 20 additions and 20 deletions
+14 -15
View File
@@ -171,16 +171,24 @@ impl<'open> Window<'open> {
let title_bar_height =
title_label.font_height(ctx.fonts()) + 1.0 * ctx.style().item_spacing.y; // this could be better
let margins = 2.0 * frame.margin + vec2(0.0, title_bar_height);
interact(
window_interaction(
ctx,
margins,
possible,
area_layer,
area.state_mut(),
window_id,
resize_id,
window_id.with("frame_resize"),
last_frame_outer_rect,
)
.and_then(|window_interaction| {
interact(
window_interaction,
ctx,
margins,
area_layer,
area.state_mut(),
resize_id,
)
})
} else {
None
};
@@ -301,22 +309,13 @@ impl WindowInteraction {
}
fn interact(
window_interaction: WindowInteraction,
ctx: &Context,
margins: Vec2,
possible: PossibleInteractions,
area_layer: Layer,
area_state: &mut area::State,
window_id: Id,
resize_id: Id,
rect: Rect,
) -> Option<WindowInteraction> {
let window_interaction = window_interaction(
ctx,
possible,
area_layer,
window_id.with("frame_resize"),
rect,
)?;
let new_rect = resize_window(ctx, &window_interaction)?;
let new_rect = ctx.round_rect_to_pixels(new_rect);
+1 -1
View File
@@ -359,7 +359,7 @@ impl Default for Widgets {
button_enabled: true,
radio: 0,
count: 0,
slider_value: 3.14,
slider_value: 3.4,
single_line_text_input: "Hello World!".to_owned(),
multiline_text_input: "Text can both be so wide that it needs a linebreak, but you can also add manual linebreak by pressing enter, creating new paragraphs.\nThis is the start of the next paragraph.\n\nClick me to edit me!".to_owned(),
}
+1 -1
View File
@@ -607,7 +607,7 @@ pub fn ease_in_ease_out(t: f32) -> f32 {
///
/// Represents one turn in radian angles. Equal to `2 * pi`.
///
/// See https://tauday.com/
/// See <https://tauday.com/>
pub const TAU: f32 = 2.0 * std::f32::consts::PI;
pub fn round_to_precision(value: f32, precision: usize) -> f32 {
+2 -1
View File
@@ -1,4 +1,5 @@
/// Outputs render info in a format suitable for e.g. OpenGL.
#![allow(clippy::identity_op)]
use {
super::{
color::{self, srgba, Color},