Fix(ui_widgets): Add missing lifetimes
This commit is contained in:
parent
14333944dc
commit
734328787e
|
@ -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(
|
||||||
|
|
|
@ -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)));
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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),
|
||||||
|
|
Reference in New Issue