Add elided lifetimes to view helpers in examples

This commit is contained in:
Héctor Ramón Jiménez 2025-06-24 14:29:36 +02:00
parent bde4572bc5
commit 5ca5000cdc
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
50 changed files with 95 additions and 84 deletions

View file

@ -141,7 +141,7 @@ impl Tour {
}
}
fn view(&self) -> Element<Message> {
fn view(&self) -> Element<'_, Message> {
let controls =
row![]
.push_maybe(self.screen.previous().is_some().then(|| {
@ -197,7 +197,7 @@ impl Tour {
}
}
fn welcome(&self) -> Column<Message> {
fn welcome(&self) -> Column<'_, Message> {
Self::container("Welcome!")
.push(
"This is a simple tour meant to showcase a bunch of \
@ -244,7 +244,7 @@ impl Tour {
)
}
fn slider(&self) -> Column<Message> {
fn slider(&self) -> Column<'_, Message> {
Self::container("Slider")
.push(
"A slider allows you to smoothly select a value from a range \
@ -258,7 +258,7 @@ impl Tour {
.push(text(self.slider.to_string()).width(Fill).align_x(Center))
}
fn rows_and_columns(&self) -> Column<Message> {
fn rows_and_columns(&self) -> Column<'_, Message> {
let row_radio = radio(
"Row",
Layout::Row,
@ -303,7 +303,7 @@ impl Tour {
.push(spacing_section)
}
fn text(&self) -> Column<Message> {
fn text(&self) -> Column<'_, Message> {
let size = self.text_size;
let color = self.text_color;
@ -339,7 +339,7 @@ impl Tour {
.push(color_section)
}
fn radio(&self) -> Column<Message> {
fn radio(&self) -> Column<'_, Message> {
let question = column![
text("Iced is written in...").size(24),
column(
@ -374,7 +374,7 @@ impl Tour {
)
}
fn toggler(&self) -> Column<Message> {
fn toggler(&self) -> Column<'_, Message> {
Self::container("Toggler")
.push("A toggler is mostly used to enable or disable something.")
.push(
@ -387,7 +387,7 @@ impl Tour {
)
}
fn image(&self) -> Column<Message> {
fn image(&self) -> Column<'_, Message> {
let width = self.image_width;
let filter_method = self.image_filter_method;
@ -406,7 +406,7 @@ impl Tour {
.align_x(Center)
}
fn scrollable(&self) -> Column<Message> {
fn scrollable(&self) -> Column<'_, Message> {
Self::container("Scrollable")
.push(
"Iced supports scrollable content. Try it out! Find the \
@ -428,7 +428,7 @@ impl Tour {
.push(text("You made it!").width(Fill).size(50).align_x(Center))
}
fn text_input(&self) -> Column<Message> {
fn text_input(&self) -> Column<'_, Message> {
let value = &self.input_value;
let is_secure = self.input_is_secure;
let is_showing_icon = self.input_is_showing_icon;
@ -474,7 +474,7 @@ impl Tour {
)
}
fn debugger(&self) -> Column<Message> {
fn debugger(&self) -> Column<'_, Message> {
Self::container("Debugger")
.push(
"You can ask Iced to visually explain the layouting of the \
@ -491,7 +491,7 @@ impl Tour {
.push("Feel free to go back and take a look.")
}
fn end(&self) -> Column<Message> {
fn end(&self) -> Column<'_, Message> {
Self::container("You reached the end!")
.push("This tour will be updated as more features are added.")
.push("Make sure to keep an eye on it!")