Update RPIT lifetime bounds for the 2024 edition

When the bound matches the implicit bound, i.e. when you'd just write

    impl ... + use<'_>

then it can be omitted. My gut instinct is to always write the bound
explicitly, but maybe that'll harm readability once I'm more used to how
bounds work now.

Anyways, always try to keep the bound as small as possible, ideally just

    impl ... + use<>
This commit is contained in:
Joscha 2025-02-21 19:15:33 +01:00
parent d29e3e6651
commit 6c884f3077
6 changed files with 7 additions and 7 deletions

View file

@ -35,7 +35,7 @@ impl LoggedOut {
} }
} }
fn widget(&mut self) -> impl Widget<UiError> + '_ { fn widget(&mut self) -> impl Widget<UiError> {
let bold = Style::new().bold(); let bold = Style::new().bold();
Join4::vertical( Join4::vertical(
Text::new(("Not logged in", bold.yellow())).segment(), Text::new(("Not logged in", bold.yellow())).segment(),
@ -111,7 +111,7 @@ impl AccountUiState {
} }
} }
pub fn widget(&mut self) -> impl Widget<UiError> + '_ { pub fn widget(&mut self) -> impl Widget<UiError> {
let inner = match self { let inner = match self {
Self::LoggedOut(logged_out) => logged_out.widget().first2(), Self::LoggedOut(logged_out) => logged_out.widget().first2(),
Self::LoggedIn(logged_in) => logged_in.widget().second2(), Self::LoggedIn(logged_in) => logged_in.widget().second2(),

View file

@ -13,7 +13,7 @@ pub fn new() -> EditorState {
EditorState::new() EditorState::new()
} }
pub fn widget(editor: &mut EditorState) -> impl Widget<UiError> + '_ { pub fn widget(editor: &mut EditorState) -> impl Widget<UiError> {
Popup::new( Popup::new(
editor.widget().with_hidden_default_placeholder(), editor.widget().with_hidden_default_placeholder(),
"Enter password", "Enter password",

View file

@ -38,7 +38,7 @@ impl LinksState {
} }
} }
pub fn widget(&mut self) -> impl Widget<UiError> + '_ { pub fn widget(&mut self) -> impl Widget<UiError> {
let style_selected = Style::new().black().on_white(); let style_selected = Style::new().black().on_white();
let mut list_builder = ListBuilder::new(); let mut list_builder = ListBuilder::new();

View file

@ -14,7 +14,7 @@ pub fn new(joined: Joined) -> EditorState {
EditorState::with_initial_text(joined.session.name) EditorState::with_initial_text(joined.session.name)
} }
pub fn widget(editor: &mut EditorState) -> impl Widget<UiError> + '_ { pub fn widget(editor: &mut EditorState) -> impl Widget<UiError> {
let inner = editor let inner = editor
.widget() .widget()
.with_highlight(|s| euph::style_nick_exact(s, Style::new())); .with_highlight(|s| euph::style_nick_exact(s, Style::new()));

View file

@ -84,7 +84,7 @@ impl ConnectState {
ConnectResult::Unhandled ConnectResult::Unhandled
} }
pub fn widget(&mut self) -> impl Widget<UiError> + '_ { pub fn widget(&mut self) -> impl Widget<UiError> {
let room_style = Style::new().bold().blue(); let room_style = Style::new().bold().blue();
let domain_style = Style::new().grey(); let domain_style = Style::new().grey();

View file

@ -47,7 +47,7 @@ impl DeleteState {
DeleteResult::Unhandled DeleteResult::Unhandled
} }
pub fn widget(&mut self) -> impl Widget<UiError> + '_ { pub fn widget(&mut self) -> impl Widget<UiError> {
let warn_style = Style::new().bold().red(); let warn_style = Style::new().bold().red();
let room_style = Style::new().bold().blue(); let room_style = Style::new().bold().blue();
let text = Styled::new_plain("Are you sure you want to delete ") let text = Styled::new_plain("Are you sure you want to delete ")