forked from trinitrix/core
1
0
Fork 0

Fix(ui_widgets): Add missing lifetimes

This commit is contained in:
Benedikt Peetz 2023-07-18 08:12:33 +02:00
parent 14333944dc
commit 734328787e
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
4 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ use tui::{
use crate::{app::status::Room, ui::central::InputPosition}; use crate::{app::status::Room, ui::central::InputPosition};
pub fn init<'a>(room: Option<&Room>, colors: &Vec<Color>) -> Result<(List<'a>, ListState)> { pub fn init<'a>(room: Option<&'a Room>, colors: &Vec<Color>) -> Result<(List<'a>, ListState)> {
let content = match room { let content = match room {
Some(room) => get_content_from_room(room).context("Failed to get content from room")?, Some(room) => get_content_from_room(room).context("Failed to get content from room")?,
None => vec![ListItem::new(Text::styled( None => vec![ListItem::new(Text::styled(

View File

@ -6,7 +6,7 @@ use tui::{
use crate::{app::status::Room, ui::central::InputPosition}; use crate::{app::status::Room, ui::central::InputPosition};
pub fn init<'a>(room: Option<&Room>, colors: &Vec<Color>) -> Paragraph<'a> { pub fn init<'a>(room: Option<&'a Room>, colors: &Vec<Color>) -> Paragraph<'a> {
let mut room_info_content = Text::default(); let mut room_info_content = Text::default();
if let Some(room) = room { if let Some(room) = room {
room_info_content.extend(Text::styled(room.name(), Style::default().fg(Color::Cyan))); room_info_content.extend(Text::styled(room.name(), Style::default().fg(Color::Cyan)));

View File

@ -6,7 +6,7 @@ use tui::{
use crate::{app::status::Status, ui::central::InputPosition}; use crate::{app::status::Status, ui::central::InputPosition};
pub fn init<'a>(status: &Status, colors: &Vec<Color>) -> List<'a> { pub fn init<'a>(status: &'a Status, colors: &Vec<Color>) -> List<'a> {
let rooms_content: Vec<_> = status let rooms_content: Vec<_> = status
.rooms() .rooms()
.iter() .iter()

View File

@ -7,7 +7,7 @@ use tui::{
use crate::{app::status::Status, ui::central::InputPosition}; use crate::{app::status::Status, ui::central::InputPosition};
pub fn init<'a>(status: &Status, colors: &Vec<Color>) -> Paragraph<'a> { pub fn init<'a>(status: &'a Status, colors: &Vec<Color>) -> Paragraph<'a> {
let mut status_content = Text::styled( let mut status_content = Text::styled(
status.account_name(), status.account_name(),
Style::default().add_modifier(Modifier::BOLD), Style::default().add_modifier(Modifier::BOLD),