From e0378903d915d0000f06eb7a47f866f6cb9e7299 Mon Sep 17 00:00:00 2001 From: mostafaei2002 Date: Tue, 11 Jun 2024 21:35:47 +0330 Subject: [PATCH] fix: compile error --- src/app/panels/middle/xvb.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/panels/middle/xvb.rs b/src/app/panels/middle/xvb.rs index ceef50d..283ca6c 100644 --- a/src/app/panels/middle/xvb.rs +++ b/src/app/panels/middle/xvb.rs @@ -168,7 +168,7 @@ impl crate::disk::state::Xvb { ui.add_space(space_h); let mut is_slider_enabled = true; - let hashrate_xmrig = { + let mut hashrate_xmrig = { if lock!(gui_api_xmrig).hashrate_raw_15m > 0.0 { lock!(gui_api_xmrig).hashrate_raw_15m } else if lock!(gui_api_xmrig).hashrate_raw_1m > 0.0 { @@ -183,13 +183,10 @@ impl crate::disk::state::Xvb { // Adjust maximum slider amount based on slider metric - match self.manual_donation_metric { - ManualDonationMetric::Kilo => { - hashrate_xmrig /= 1000.0; - }, - ManualDonationMetric::Mega => { - hashrate_xmrig /= 1_000_000.0; - } + if self.manual_donation_metric == ManualDonationMetric::Kilo { + hashrate_xmrig /= 1000.0; + } else if self.manual_donation_metric == ManualDonationMetric::Mega { + hashrate_xmrig /= 1_000_000.0; }