misc clippy fixes from 1.60.0
This commit is contained in:
@@ -101,9 +101,7 @@ impl Default for InputState {
|
||||
impl InputState {
|
||||
#[must_use]
|
||||
pub fn begin_frame(mut self, new: RawInput) -> InputState {
|
||||
let time = new
|
||||
.time
|
||||
.unwrap_or_else(|| self.time + new.predicted_dt as f64);
|
||||
let time = new.time.unwrap_or(self.time + new.predicted_dt as f64);
|
||||
let unstable_dt = (time - self.time) as f32;
|
||||
let screen_rect = new.screen_rect.unwrap_or(self.screen_rect);
|
||||
self.create_touch_states_for_new_devices(&new.events);
|
||||
|
||||
+6
-8
@@ -772,32 +772,30 @@ impl Layout {
|
||||
let cursor = region.cursor;
|
||||
let next_pos = self.next_widget_position(region);
|
||||
|
||||
let align;
|
||||
|
||||
let l = 64.0;
|
||||
|
||||
match self.main_dir {
|
||||
let align = match self.main_dir {
|
||||
Direction::LeftToRight => {
|
||||
painter.line_segment([cursor.left_top(), cursor.left_bottom()], stroke);
|
||||
painter.arrow(next_pos, vec2(l, 0.0), stroke);
|
||||
align = Align2([Align::LEFT, self.vertical_align()]);
|
||||
Align2([Align::LEFT, self.vertical_align()])
|
||||
}
|
||||
Direction::RightToLeft => {
|
||||
painter.line_segment([cursor.right_top(), cursor.right_bottom()], stroke);
|
||||
painter.arrow(next_pos, vec2(-l, 0.0), stroke);
|
||||
align = Align2([Align::RIGHT, self.vertical_align()]);
|
||||
Align2([Align::RIGHT, self.vertical_align()])
|
||||
}
|
||||
Direction::TopDown => {
|
||||
painter.line_segment([cursor.left_top(), cursor.right_top()], stroke);
|
||||
painter.arrow(next_pos, vec2(0.0, l), stroke);
|
||||
align = Align2([self.horizontal_align(), Align::TOP]);
|
||||
Align2([self.horizontal_align(), Align::TOP])
|
||||
}
|
||||
Direction::BottomUp => {
|
||||
painter.line_segment([cursor.left_bottom(), cursor.right_bottom()], stroke);
|
||||
painter.arrow(next_pos, vec2(0.0, -l), stroke);
|
||||
align = Align2([self.horizontal_align(), Align::BOTTOM]);
|
||||
Align2([self.horizontal_align(), Align::BOTTOM])
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
painter.debug_text(next_pos, align, stroke.color, text);
|
||||
}
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ impl MenuRootManager {
|
||||
) -> Option<InnerResponse<R>> {
|
||||
if let Some(root) = self.inner.as_mut() {
|
||||
let (menu_response, inner_response) = root.show(response, add_contents);
|
||||
if let MenuResponse::Close = menu_response {
|
||||
if MenuResponse::Close == menu_response {
|
||||
self.inner = None;
|
||||
}
|
||||
inner_response
|
||||
|
||||
Reference in New Issue
Block a user