Skip to content

Commit 03f5af3

Browse files
committed
Remove unstable-widget-ref as unused
Replaced with regular Widget. There was a change related to this in ratatui 0.30. Apparently there wasn't even a need to use the WidgetRef in the first place. Reference: https://github.com/ratatui/ratatui/blob/01a15f9/BREAKING-CHANGES.md#widgetref-no-longer-has-a-blanket-implementation-of-widget
1 parent 0b7e9ab commit 03f5af3

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

basalt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2021"
1111

1212
[dependencies]
1313
basalt-core = { path = "../basalt-core", version = "0.8.1" }
14-
ratatui = { version = "0.30.0", features = ["unstable-widget-ref"] }
14+
ratatui = { version = "0.30.0" }
1515
crossterm = "0.29.0"
1616
pulldown-cmark = "0.13.0"
1717
textwrap = "0.16.2"

basalt/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl<'a> App<'a> {
430430
}
431431

432432
fn render_splash(&self, area: Rect, buf: &mut Buffer, state: &mut SplashModalState<'a>) {
433-
SplashModal::default().render_ref(area, buf, state)
433+
SplashModal::default().render(area, buf, state)
434434
}
435435

436436
fn render_main(&self, area: Rect, buf: &mut Buffer, state: &mut AppState<'a>) {

basalt/src/note_editor/cursor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::ControlFlow;
33
use ratatui::{
44
buffer::Buffer,
55
layout::{Offset, Rect},
6-
style::{Style, Stylize},
6+
style::Style,
77
widgets::StatefulWidget,
88
};
99
use unicode_width::UnicodeWidthChar;

basalt/src/splash_modal.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use ratatui::{
66
layout::{Constraint, Flex, Layout, Rect},
77
style::Stylize,
88
text::Text,
9-
widgets::{Clear, StatefulWidgetRef, Widget},
9+
widgets::{Clear, StatefulWidget, Widget},
1010
};
1111

1212
use crate::{
@@ -125,10 +125,10 @@ pub struct SplashModal<'a> {
125125
_lifetime: PhantomData<&'a ()>,
126126
}
127127

128-
impl<'a> StatefulWidgetRef for SplashModal<'a> {
128+
impl<'a> StatefulWidget for SplashModal<'a> {
129129
type State = SplashModalState<'a>;
130130

131-
fn render_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
131+
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
132132
Clear.render(area, buf);
133133

134134
let [_, center, _] = Layout::horizontal([
@@ -184,6 +184,6 @@ impl<'a> StatefulWidgetRef for SplashModal<'a> {
184184
.centered()
185185
.render(help, buf);
186186

187-
VaultSelector::default().render_ref(bottom, buf, &mut state.vault_selector_state);
187+
VaultSelector::default().render(bottom, buf, &mut state.vault_selector_state);
188188
}
189189
}

basalt/src/vault_selector.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ratatui::{
55
buffer::Buffer,
66
layout::Rect,
77
style::{Color, Style, Stylize},
8-
widgets::{Block, BorderType, List, ListItem, ListState, StatefulWidgetRef},
8+
widgets::{Block, BorderType, List, ListItem, ListState, StatefulWidget},
99
};
1010

1111
#[derive(Debug, Default, Clone, PartialEq)]
@@ -59,10 +59,10 @@ pub struct VaultSelector<'a> {
5959
_lifetime: PhantomData<&'a ()>,
6060
}
6161

62-
impl<'a> StatefulWidgetRef for VaultSelector<'a> {
62+
impl<'a> StatefulWidget for VaultSelector<'a> {
6363
type State = VaultSelectorState<'a>;
6464

65-
fn render_ref(&self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
65+
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
6666
let items: Vec<ListItem> = state
6767
.items
6868
.iter()
@@ -86,6 +86,6 @@ impl<'a> StatefulWidgetRef for VaultSelector<'a> {
8686
.fg(Color::default())
8787
.highlight_style(Style::new().reversed().dark_gray())
8888
.highlight_symbol(" ")
89-
.render_ref(area, buf, &mut state.list_state);
89+
.render(area, buf, &mut state.list_state);
9090
}
9191
}

basalt/src/vault_selector_modal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use basalt_core::obsidian::Vault;
44
use ratatui::{
55
buffer::Buffer,
66
layout::{Constraint, Flex, Layout, Rect},
7-
widgets::{Clear, ScrollbarState, StatefulWidget, StatefulWidgetRef, Widget},
7+
widgets::{Clear, ScrollbarState, StatefulWidget, Widget},
88
};
99

1010
use crate::{
@@ -115,7 +115,7 @@ impl<'a> StatefulWidget for VaultSelectorModal<'a> {
115115
{
116116
let area = self.modal_area(area);
117117
Widget::render(Clear, area, buf);
118-
VaultSelector::default().render_ref(area, buf, &mut state.vault_selector_state);
118+
VaultSelector::default().render(area, buf, &mut state.vault_selector_state);
119119
}
120120
}
121121

0 commit comments

Comments
 (0)