Skip to content

Commit

Permalink
fix(deps): deprecated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpsoane committed Dec 1, 2024
1 parent 6deaf51 commit 51f2edd
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions src/components/alert_modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use core::fmt;
use color_eyre::eyre::Result;

use ratatui::{
layout::{Alignment, Rect},
text::{Span, Text},
widgets::{block::Title, Paragraph, Wrap},
layout::Rect,
text::{Line, Span, Text},
widgets::{Paragraph, Wrap},
Frame,
};

Expand Down Expand Up @@ -73,7 +73,7 @@ where
_ => return,
};

let title = Title::from(format!("< {} >", self.title.clone())).alignment(Alignment::Center);
let title = Line::from(format!("< {} >", self.title.clone())).centered();

Check warning on line 76 in src/components/alert_modal.rs

View check run for this annotation

Codecov / codecov/patch

src/components/alert_modal.rs#L76

Added line #L76 was not covered by tests

let message = Paragraph::new(Text::from(message))
.wrap(Wrap { trim: true })
Expand Down
8 changes: 4 additions & 4 deletions src/components/boolean_modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use itertools::Itertools;

use color_eyre::eyre::Result;
use ratatui::{
layout::{Alignment, Rect},
layout::Rect,
style::{Modifier, Style},
text::{Span, Text},
widgets::{block::Title, Paragraph, Wrap},
text::{Line, Span, Text},
widgets::{Paragraph, Wrap},
Frame,
};

Expand Down Expand Up @@ -89,7 +89,7 @@ where
_ => return,
};

let title = Title::from(format!("< {} >", self.title.clone())).alignment(Alignment::Center);
let title = Line::from(format!("< {} >", self.title.clone())).centered();

Check warning on line 92 in src/components/boolean_modal.rs

View check run for this annotation

Codecov / codecov/patch

src/components/boolean_modal.rs#L92

Added line #L92 was not covered by tests

let message = Paragraph::new(Text::from(message))
.wrap(Wrap { trim: true })
Expand Down
5 changes: 2 additions & 3 deletions src/components/resize_notice.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::sync::Arc;

use ratatui::{
layout::{self},
style::Style,
text::{Line, Span, Text},
widgets::{block::Title, Block},
widgets::Block,
};
use ratatui_macros::{horizontal, vertical};

Expand Down Expand Up @@ -79,7 +78,7 @@ impl Component for ResizeScreen {
let info = Text::from(messages).alignment(ratatui::layout::Alignment::Center);

let block = Block::bordered()
.title(Title::from("< Terminal Too Small >").alignment(layout::Alignment::Center))
.title(Line::from("< Terminal Too Small >").centered())

Check warning on line 81 in src/components/resize_notice.rs

View check run for this annotation

Codecov / codecov/patch

src/components/resize_notice.rs#L81

Added line #L81 was not covered by tests
.border_style(Style::default().fg(self.config.theme.negative_highlight()));

let [_, inner_area, _] = vertical![>=0, <=5, >=0].areas(area);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ impl Component for Containers {

let table = Table::new(rows.clone(), widths)
.header(columns.clone().style(Style::new().bold()))
.highlight_style(Style::new().reversed());
.row_highlight_style(Style::new().reversed());

Check warning on line 355 in src/pages/containers.rs

View check run for this annotation

Codecov / codecov/patch

src/pages/containers.rs#L355

Added line #L355 was not covered by tests

f.render_stateful_widget(table, area, &mut self.list_state);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl Component for Images {

let table = Table::new(rows.clone(), widths)
.header(columns.clone().style(Style::new().bold()))
.highlight_style(Style::new().reversed());
.row_highlight_style(Style::new().reversed());

Check warning on line 312 in src/pages/images.rs

View check run for this annotation

Codecov / codecov/patch

src/pages/images.rs#L312

Added line #L312 was not covered by tests

f.render_stateful_widget(table, area, &mut self.list_state);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl Component for Network {

let table = Table::new(rows.clone(), widths)
.header(columns.clone().style(Style::new().bold()))
.highlight_style(Style::new().reversed());
.row_highlight_style(Style::new().reversed());

Check warning on line 301 in src/pages/networks.rs

View check run for this annotation

Codecov / codecov/patch

src/pages/networks.rs#L301

Added line #L301 was not covered by tests

f.render_stateful_widget(table, area, &mut self.list_state);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/volumes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl Component for Volume {

let table = Table::new(rows.clone(), widths)
.header(columns.clone().style(Style::new().bold()))
.highlight_style(Style::new().reversed());
.row_highlight_style(Style::new().reversed());

Check warning on line 309 in src/pages/volumes.rs

View check run for this annotation

Codecov / codecov/patch

src/pages/volumes.rs#L309

Added line #L309 was not covered by tests

f.render_stateful_widget(table, area, &mut self.list_state);

Expand Down
9 changes: 5 additions & 4 deletions src/ui/page_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use std::sync::Arc;
use bollard::Docker;
use color_eyre::eyre::{Context, Result};
use ratatui::{
layout::{Alignment, Margin, Rect},
widgets::{block::Title, Block, Padding},
layout::{Margin, Rect},
text::Line,
widgets::{Block, Padding},
Frame,
};
use tokio::sync::mpsc::Sender;
Expand Down Expand Up @@ -182,11 +183,11 @@ impl Component for PageManager {
fn draw(&mut self, f: &mut Frame<'_>, area: Rect) {
let title_message = self.page.get_help().lock().unwrap().get_name();

let title = Title::from(format!("< {} >", title_message)).alignment(Alignment::Center);
let title = Line::from(format!("< {} >", title_message)).centered();

Check warning on line 186 in src/ui/page_manager.rs

View check run for this annotation

Codecov / codecov/patch

src/ui/page_manager.rs#L186

Added line #L186 was not covered by tests

let block = Block::bordered()
.border_type(ratatui::widgets::BorderType::Plain)
.title(title)
.title_top(title)

Check warning on line 190 in src/ui/page_manager.rs

View check run for this annotation

Codecov / codecov/patch

src/ui/page_manager.rs#L190

Added line #L190 was not covered by tests
.padding(Padding::left(300));

f.render_widget(block, area);
Expand Down
10 changes: 5 additions & 5 deletions src/widgets/modal.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
use ratatui::{
style::Style,
text::{Line, Span, Text},
widgets::{block::Title, Block, Clear, Paragraph, Widget, Wrap},
widgets::{Block, Clear, Paragraph, Widget, Wrap},
};
use ratatui_macros::{horizontal, vertical};

const UPPER_PAD_SIZE: u16 = 1;
const MID_PAD_SIZE: u16 = 1;

pub struct ModalWidget<'a> {
title: Title<'a>,
title: Line<'a>,
prompt: Paragraph<'a>,
opts: Vec<Span<'a>>,
width: u16,
height: u16,
}

impl<'a> ModalWidget<'a> {
pub fn new(title: Title<'a>, prompt: Paragraph<'a>, opts: Vec<Span<'a>>) -> Self {
pub fn new(title: Line<'a>, prompt: Paragraph<'a>, opts: Vec<Span<'a>>) -> Self {

Check warning on line 20 in src/widgets/modal.rs

View check run for this annotation

Codecov / codecov/patch

src/widgets/modal.rs#L20

Added line #L20 was not covered by tests
Self {
title,
prompt,
Expand All @@ -30,7 +30,7 @@ impl<'a> ModalWidget<'a> {
impl<'a> Default for ModalWidget<'a> {

Check warning on line 30 in src/widgets/modal.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a --> src/widgets/modal.rs:30:6 | 30 | impl<'a> Default for ModalWidget<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 30 - impl<'a> Default for ModalWidget<'a> { 30 + impl Default for ModalWidget<'_> { |

Check warning on line 30 in src/widgets/modal.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a --> src/widgets/modal.rs:30:6 | 30 | impl<'a> Default for ModalWidget<'a> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 30 - impl<'a> Default for ModalWidget<'a> { 30 + impl Default for ModalWidget<'_> { |
fn default() -> Self {
Self {
title: Title::from(""),
title: Line::from(""),

Check warning on line 33 in src/widgets/modal.rs

View check run for this annotation

Codecov / codecov/patch

src/widgets/modal.rs#L33

Added line #L33 was not covered by tests
prompt: Paragraph::new(Text::from("")),
opts: vec![],
width: 60,
Expand All @@ -52,7 +52,7 @@ impl<'a> Widget for ModalWidget<'a> {
let [_, area, _] = vertical![>=0, ==height, >=0 ].areas(area);

let block = Block::bordered()
.title(self.title)
.title(self.title.centered())

Check warning on line 55 in src/widgets/modal.rs

View check run for this annotation

Codecov / codecov/patch

src/widgets/modal.rs#L55

Added line #L55 was not covered by tests
.border_style(Style::default())
.style(Style::default());

Expand Down

0 comments on commit 51f2edd

Please sign in to comment.