| @@ -97,12 +97,12 @@ fn bold_style() -> Style { |
| 97 | } |
97 | } |
| 98 | |
98 | |
| 99 | #[inline] |
99 | #[inline] |
| 100 | fn bold_span(s: &str) -> Span { |
100 | fn bold_span(s: &str) -> Span<'_> { |
| 101 | Span::styled(s, bold_style()) |
101 | Span::styled(s, bold_style()) |
| 102 | } |
102 | } |
| 103 | |
103 | |
| 104 | #[inline] |
104 | #[inline] |
| 105 | fn bold_spans(s: &str) -> Line { |
105 | fn bold_spans(s: &str) -> Line<'_> { |
| 106 | bold_span(s).into() |
106 | bold_span(s).into() |
| 107 | } |
107 | } |
| 108 | |
108 | |
| @@ -116,12 +116,12 @@ fn selected_style(selected: bool) -> Style { |
| 116 | } |
116 | } |
| 117 | |
117 | |
| 118 | #[inline] |
118 | #[inline] |
| 119 | fn selected_span(s: &str, selected: bool) -> Span { |
119 | fn selected_span(s: &str, selected: bool) -> Span<'_> { |
| 120 | Span::styled(s, selected_style(selected)) |
120 | Span::styled(s, selected_style(selected)) |
| 121 | } |
121 | } |
| 122 | |
122 | |
| 123 | #[inline] |
123 | #[inline] |
| 124 | fn selected_text(s: &str, selected: bool) -> Text { |
124 | fn selected_text(s: &str, selected: bool) -> Text<'_> { |
| 125 | Text::from(selected_span(s, selected)) |
125 | Text::from(selected_span(s, selected)) |
| 126 | } |
126 | } |
| 127 | |
127 | |
| @@ -743,7 +743,7 @@ impl Window<IambInfo> for IambWindow { |
| 743 | } |
743 | } |
| 744 | } |
744 | } |
| 745 | |
745 | |
| 746 | fn get_tab_title(&self, store: &mut ProgramStore) -> Line { |
746 | fn get_tab_title(&self, store: &mut ProgramStore) -> Line<'_> { |
| 747 | match self { |
747 | match self { |
| 748 | IambWindow::DirectList(_) => bold_spans("Direct Messages"), |
748 | IambWindow::DirectList(_) => bold_spans("Direct Messages"), |
| 749 | IambWindow::RoomList(_) => bold_spans("Rooms"), |
749 | IambWindow::RoomList(_) => bold_spans("Rooms"), |
| @@ -771,7 +771,7 @@ impl Window<IambInfo> for IambWindow { |
| 771 | } |
771 | } |
| 772 | } |
772 | } |
| 773 | |
773 | |
| 774 | fn get_win_title(&self, store: &mut ProgramStore) -> Line { |
774 | fn get_win_title(&self, store: &mut ProgramStore) -> Line<'_> { |
| 775 | match self { |
775 | match self { |
| 776 | IambWindow::DirectList(_) => bold_spans("Direct Messages"), |
776 | IambWindow::DirectList(_) => bold_spans("Direct Messages"), |
| 777 | IambWindow::RoomList(_) => bold_spans("Rooms"), |
777 | IambWindow::RoomList(_) => bold_spans("Rooms"), |
| @@ -959,7 +959,12 @@ impl Display for GenericChatItem { |
| 959 | } |
959 | } |
| 960 | |
960 | |
| 961 | impl ListItem<IambInfo> for GenericChatItem { |
961 | impl ListItem<IambInfo> for GenericChatItem { |
| 962 | fn show(&self, selected: bool, _: &ViewportContext<ListCursor>, _: &mut ProgramStore) -> Text { |
962 | fn show( |
| |
963 | &self, |
| |
964 | selected: bool, |
| |
965 | _: &ViewportContext<ListCursor>, |
| |
966 | _: &mut ProgramStore, |
| |
967 | ) -> Text<'_> { |
| 963 | let unread = self.unread.is_unread(); |
968 | let unread = self.unread.is_unread(); |
| 964 | let style = selected_style(selected); |
969 | let style = selected_style(selected); |
| 965 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
970 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
| @@ -1073,7 +1078,12 @@ impl Display for RoomItem { |
| 1073 | } |
1078 | } |
| 1074 | |
1079 | |
| 1075 | impl ListItem<IambInfo> for RoomItem { |
1080 | impl ListItem<IambInfo> for RoomItem { |
| 1076 | fn show(&self, selected: bool, _: &ViewportContext<ListCursor>, _: &mut ProgramStore) -> Text { |
1081 | fn show( |
| |
1082 | &self, |
| |
1083 | selected: bool, |
| |
1084 | _: &ViewportContext<ListCursor>, |
| |
1085 | _: &mut ProgramStore, |
| |
1086 | ) -> Text<'_> { |
| 1077 | let unread = self.unread.is_unread(); |
1087 | let unread = self.unread.is_unread(); |
| 1078 | let style = selected_style(selected); |
1088 | let style = selected_style(selected); |
| 1079 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
1089 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
| @@ -1177,7 +1187,12 @@ impl Display for DirectItem { |
| 1177 | } |
1187 | } |
| 1178 | |
1188 | |
| 1179 | impl ListItem<IambInfo> for DirectItem { |
1189 | impl ListItem<IambInfo> for DirectItem { |
| 1180 | fn show(&self, selected: bool, _: &ViewportContext<ListCursor>, _: &mut ProgramStore) -> Text { |
1190 | fn show( |
| |
1191 | &self, |
| |
1192 | selected: bool, |
| |
1193 | _: &ViewportContext<ListCursor>, |
| |
1194 | _: &mut ProgramStore, |
| |
1195 | ) -> Text<'_> { |
| 1181 | let unread = self.unread.is_unread(); |
1196 | let unread = self.unread.is_unread(); |
| 1182 | let style = selected_style(selected); |
1197 | let style = selected_style(selected); |
| 1183 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
1198 | let (name, mut labels) = name_and_labels(&self.name, unread, style); |
| @@ -1280,7 +1295,12 @@ impl Display for SpaceItem { |
| 1280 | } |
1295 | } |
| 1281 | |
1296 | |
| 1282 | impl ListItem<IambInfo> for SpaceItem { |
1297 | impl ListItem<IambInfo> for SpaceItem { |
| 1283 | fn show(&self, selected: bool, _: &ViewportContext<ListCursor>, _: &mut ProgramStore) -> Text { |
1298 | fn show( |
| |
1299 | &self, |
| |
1300 | selected: bool, |
| |
1301 | _: &ViewportContext<ListCursor>, |
| |
1302 | _: &mut ProgramStore, |
| |
1303 | ) -> Text<'_> { |
| 1284 | selected_text(self.name.as_str(), selected) |
1304 | selected_text(self.name.as_str(), selected) |
| 1285 | } |
1305 | } |
| 1286 | |
1306 | |
| @@ -1411,7 +1431,12 @@ impl Display for VerifyItem { |
| 1411 | } |
1431 | } |
| 1412 | |
1432 | |
| 1413 | impl ListItem<IambInfo> for VerifyItem { |
1433 | impl ListItem<IambInfo> for VerifyItem { |
| 1414 | fn show(&self, selected: bool, _: &ViewportContext<ListCursor>, _: &mut ProgramStore) -> Text { |
1434 | fn show( |
| |
1435 | &self, |
| |
1436 | selected: bool, |
| |
1437 | _: &ViewportContext<ListCursor>, |
| |
1438 | _: &mut ProgramStore, |
| |
1439 | ) -> Text<'_> { |
| 1415 | let mut lines = vec![]; |
1440 | let mut lines = vec![]; |
| 1416 | |
1441 | |
| 1417 | let bold = Style::default().add_modifier(StyleModifier::BOLD); |
1442 | let bold = Style::default().add_modifier(StyleModifier::BOLD); |
| @@ -1521,7 +1546,7 @@ impl ListItem<IambInfo> for MemberItem { |
| 1521 | selected: bool, |
1546 | selected: bool, |
| 1522 | _: &ViewportContext<ListCursor>, |
1547 | _: &ViewportContext<ListCursor>, |
| 1523 | store: &mut ProgramStore, |
1548 | store: &mut ProgramStore, |
| 1524 | ) -> Text { |
1549 | ) -> Text<'_> { |
| 1525 | let info = store.application.rooms.get_or_default(self.room_id.clone()); |
1550 | let info = store.application.rooms.get_or_default(self.room_id.clone()); |
| 1526 | let user_id = self.member.user_id(); |
1551 | let user_id = self.member.user_id(); |
| 1527 | |
1552 | |