From 734328787e13c50fbcee8eb15f19df8bd34d0ac6 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 18 Jul 2023 08:12:33 +0200 Subject: [PATCH] Fix(ui_widgets): Add missing lifetimes --- src/ui/central/update/widgets/messages.rs | 2 +- src/ui/central/update/widgets/room_info.rs | 2 +- src/ui/central/update/widgets/rooms.rs | 2 +- src/ui/central/update/widgets/status.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/central/update/widgets/messages.rs b/src/ui/central/update/widgets/messages.rs index 0c077b8..9a4f64d 100644 --- a/src/ui/central/update/widgets/messages.rs +++ b/src/ui/central/update/widgets/messages.rs @@ -9,7 +9,7 @@ use tui::{ use crate::{app::status::Room, ui::central::InputPosition}; -pub fn init<'a>(room: Option<&Room>, colors: &Vec) -> Result<(List<'a>, ListState)> { +pub fn init<'a>(room: Option<&'a Room>, colors: &Vec) -> Result<(List<'a>, ListState)> { let content = match room { Some(room) => get_content_from_room(room).context("Failed to get content from room")?, None => vec![ListItem::new(Text::styled( diff --git a/src/ui/central/update/widgets/room_info.rs b/src/ui/central/update/widgets/room_info.rs index a277e65..3563c55 100644 --- a/src/ui/central/update/widgets/room_info.rs +++ b/src/ui/central/update/widgets/room_info.rs @@ -6,7 +6,7 @@ use tui::{ use crate::{app::status::Room, ui::central::InputPosition}; -pub fn init<'a>(room: Option<&Room>, colors: &Vec) -> Paragraph<'a> { +pub fn init<'a>(room: Option<&'a Room>, colors: &Vec) -> Paragraph<'a> { let mut room_info_content = Text::default(); if let Some(room) = room { room_info_content.extend(Text::styled(room.name(), Style::default().fg(Color::Cyan))); diff --git a/src/ui/central/update/widgets/rooms.rs b/src/ui/central/update/widgets/rooms.rs index 4e09a31..f981e96 100644 --- a/src/ui/central/update/widgets/rooms.rs +++ b/src/ui/central/update/widgets/rooms.rs @@ -6,7 +6,7 @@ use tui::{ use crate::{app::status::Status, ui::central::InputPosition}; -pub fn init<'a>(status: &Status, colors: &Vec) -> List<'a> { +pub fn init<'a>(status: &'a Status, colors: &Vec) -> List<'a> { let rooms_content: Vec<_> = status .rooms() .iter() diff --git a/src/ui/central/update/widgets/status.rs b/src/ui/central/update/widgets/status.rs index 108668e..0d87034 100644 --- a/src/ui/central/update/widgets/status.rs +++ b/src/ui/central/update/widgets/status.rs @@ -7,7 +7,7 @@ use tui::{ use crate::{app::status::Status, ui::central::InputPosition}; -pub fn init<'a>(status: &Status, colors: &Vec) -> Paragraph<'a> { +pub fn init<'a>(status: &'a Status, colors: &Vec) -> Paragraph<'a> { let mut status_content = Text::styled( status.account_name(), Style::default().add_modifier(Modifier::BOLD),