diff options
| author | Joe Carstairs <me@joeac.net> | 2025-08-25 18:22:00 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2025-08-25 18:22:00 +0100 |
| commit | 86487b8ff6e691f2b261a93733df8f4cc5dc7320 (patch) | |
| tree | 8d116acb31fe3bf8ce5d4201ae0bbc36ce6cc38a /schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs | |
| parent | fe85652e4d3e8906824baddaafd05d19105579b8 (diff) | |
refactor navigation
Diffstat (limited to 'schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs')
| -rw-r--r-- | schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs | 15 |
1 files changed, 11 insertions, 4 deletions
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<Element<'a, navigation::Message<BucketNameAndBalance>>> for BucketNameAndBalance { - fn into(self) -> Element<'a, navigation::Message<BucketNameAndBalance>> { +impl<'a> From<&'a BucketNameAndBalance> for Element<'a, navigation::Message<BucketNameAndBalance>> { + 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() } |
