From 9d446b24869c9bf318c12fe43d23c28739fd6b7b Mon Sep 17 00:00:00 2001 From: xarvic Date: Sat, 21 Jan 2023 10:00:27 +0100 Subject: [PATCH] reformat fix clippy suggestions --- druid/examples/viewport_header.rs | 2 +- druid/src/widget/viewport_header.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/druid/examples/viewport_header.rs b/druid/examples/viewport_header.rs index 76bcc0da1..e73849b2c 100755 --- a/druid/examples/viewport_header.rs +++ b/druid/examples/viewport_header.rs @@ -18,13 +18,13 @@ // On Windows platform, don't show a console when opening the app. #![windows_subsystem = "windows"] +use druid::im::Vector; use druid::widget::prelude::*; use druid::widget::{Button, Controller, Flex, Label, List, Side, TextBox, ViewportHeader}; use druid::{ AppLauncher, Color, Data, Insets, Lens, LocalizedString, RoundedRectRadii, Selector, WidgetExt, WindowDesc, }; -use im::Vector; use std::sync::Arc; #[derive(Clone, Data, Lens)] diff --git a/druid/src/widget/viewport_header.rs b/druid/src/widget/viewport_header.rs index 3a8ee3a04..78b60fa41 100644 --- a/druid/src/widget/viewport_header.rs +++ b/druid/src/widget/viewport_header.rs @@ -76,7 +76,7 @@ impl ViewportHeaderConfig { let axis = self.header_side.axis(); let max = axis.major(self.content_size) - self.minimum_visible(); - self.header_side.from_inset(insets).max(0.0).min(max) + self.header_side.from_inset(insets).clamp(0.0, max) } /// The amount of pixels the viewport of the content gets cropped by the header.