summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/bucket_name_and_balance.rs
diff options
context:
space:
mode:
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.rs15
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()
}