From 86487b8ff6e691f2b261a93733df8f4cc5dc7320 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Mon, 25 Aug 2025 18:22:00 +0100 Subject: refactor navigation --- .../src/gui/components/bucket_name_and_balance.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs') diff --git a/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs b/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs index 24a3952..b08729c 100644 --- a/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs +++ b/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs @@ -14,11 +14,18 @@ impl BucketNameAndBalance { } } -impl<'a> Into>> for BucketNameAndBalance { - fn into(self) -> Element<'a, navigation::Message> { +impl<'a> From<&'a BucketNameAndBalance> for Element<'a, navigation::Message> { + fn from(bucket_name_and_balance: &'a BucketNameAndBalance) -> Self { row![ - Text::new(&self.bucket.name).as_element(), - Text::new(&self.bucket.balance.unwrap_or(0).to_string()).as_element(), + Text::new(&bucket_name_and_balance.bucket.name).as_element(), + Text::new( + &bucket_name_and_balance + .bucket + .balance + .unwrap_or(0) + .to_string() + ) + .as_element(), ] .into() } -- cgit v1.2.3