From 440b4598a3bef8cc439d77b822fda191191829c7 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..14e2ff875 100755 --- a/druid/examples/viewport_header.rs +++ b/druid/examples/viewport_header.rs @@ -24,7 +24,7 @@ use druid::{ AppLauncher, Color, Data, Insets, Lens, LocalizedString, RoundedRectRadii, Selector, WidgetExt, WindowDesc, }; -use im::Vector; +use druid::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.