diff --git a/src/gui/views/modal.rs b/src/gui/views/modal.rs index f2e1325..b6f098a 100644 --- a/src/gui/views/modal.rs +++ b/src/gui/views/modal.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::cmp::min; use std::sync::RwLock; use std::sync::atomic::{AtomicBool, Ordering}; @@ -194,8 +193,8 @@ impl Modal { // Setup width of modal content. let side_insets = View::get_left_inset() + View::get_right_inset(); - let available_width = (ui.available_width() - (side_insets + Self::DEFAULT_MARGIN)) as i64; - let width = min(available_width, Self::DEFAULT_WIDTH as i64) as f32; + let available_width = ui.available_width() - (side_insets + Self::DEFAULT_MARGIN); + let width = f32::min(available_width, Self::DEFAULT_WIDTH); // Show main content Window at given position. let (content_align, content_offset) = self.modal_position(); diff --git a/src/gui/views/wallets/content.rs b/src/gui/views/wallets/content.rs index ba3845e..85398a4 100644 --- a/src/gui/views/wallets/content.rs +++ b/src/gui/views/wallets/content.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::cmp::{max, min}; - use egui::{Align, Align2, Layout, Margin, RichText, Rounding, ScrollArea, TextStyle, Widget}; use egui_extras::{Size, StripBuilder}; @@ -244,7 +242,7 @@ impl WalletsContent { let mut rect = ui.available_rect_before_wrap(); let mut width = ui.available_width(); if !dual_panel { - width = min(width as i64, (Root::SIDE_PANEL_WIDTH * 1.3) as i64) as f32 + width = f32::min(width, (Root::SIDE_PANEL_WIDTH * 1.3)) } if width == 0.0 { return; @@ -505,8 +503,8 @@ impl WalletsContent { ui.available_width() - Root::SIDE_PANEL_WIDTH }; if dual_panel { - let min_width = (Root::SIDE_PANEL_WIDTH + View::get_right_inset()) as i64; - max(min_width, available_width as i64) as f32 + let min_width = Root::SIDE_PANEL_WIDTH + View::get_right_inset(); + f32::max(min_width, available_width) } else { if is_wallet_showing { ui.available_width()