[fractal] fractal-gtk: Fix the deprecated range pattern
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] fractal-gtk: Fix the deprecated range pattern
- Date: Tue, 27 Aug 2019 07:41:45 +0000 (UTC)
commit 92c96ad47976921fa5cbfbd66e2877032d6fa008
Author: Alistair Francis <alistair alistair23 me>
Date: Wed Aug 21 22:29:30 2019 -0700
fractal-gtk: Fix the deprecated range pattern
Recent versions of rust report this warning when building:
warning: `...` range patterns are deprecated
--> fractal-gtk/src/widgets/members_list.rs:169:14
|
169 | 1...49 => (i18n("Privileged"), "badge-grey"),
| ^^^ help: use `..=` for an inclusive range
Fix the warning by just searching and replacing the deprecated code.
Signed-off-by: Alistair Francis <alistair alistair23 me>
fractal-gtk/src/widgets/member.rs | 2 +-
fractal-gtk/src/widgets/members_list.rs | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/fractal-gtk/src/widgets/member.rs b/fractal-gtk/src/widgets/member.rs
index 771ba997..334de806 100644
--- a/fractal-gtk/src/widgets/member.rs
+++ b/fractal-gtk/src/widgets/member.rs
@@ -52,7 +52,7 @@ impl<'a> MemberBox<'a> {
let avatar = widgets::Avatar::avatar_new(Some(globals::USERLIST_ICON_SIZE));
let badge = match self.op.member_level(self.member) {
100 => Some(widgets::AvatarBadgeColor::Gold),
- 50...100 => Some(widgets::AvatarBadgeColor::Silver),
+ 50..=100 => Some(widgets::AvatarBadgeColor::Silver),
_ => None,
};
let data = avatar.circle(
diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs
index 9b665dda..fe10e5d3 100644
--- a/fractal-gtk/src/widgets/members_list.rs
+++ b/fractal-gtk/src/widgets/members_list.rs
@@ -139,8 +139,8 @@ fn load_row_content(member: Member, power_level: Option<i32>) -> gtk::Box {
let pl = power_level.unwrap_or_default();
let badge_color = match pl {
100 => Some(AvatarBadgeColor::Gold),
- 50...99 => Some(AvatarBadgeColor::Silver),
- 1...49 => Some(AvatarBadgeColor::Grey),
+ 50..=99 => Some(AvatarBadgeColor::Silver),
+ 1..=49 => Some(AvatarBadgeColor::Grey),
_ => None,
};
@@ -168,8 +168,8 @@ fn load_row_content(member: Member, power_level: Option<i32>) -> gtk::Box {
if pl > 0 && pl <= 100 {
let badge_data = match pl {
100 => (i18n("Admin"), "badge-gold"),
- 50...99 => (i18n("Moderator"), "badge-silver"),
- 1...49 => (i18n("Privileged"), "badge-grey"),
+ 50..=99 => (i18n("Moderator"), "badge-silver"),
+ 1..=49 => (i18n("Privileged"), "badge-grey"),
_ => panic!(),
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]