summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 05:47:01 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 05:47:01 +0100
commit5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb (patch)
tree07ea56036fc18f3db592264fb7991618ed1598e7 /src
parentc22269bff3085012d326a0df77bf27ad5bcb41b7 (diff)
downloadiced-5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb.tar.gz
iced-5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb.tar.bz2
iced-5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb.zip
Rename `Program::new` to `build`
Diffstat (limited to 'src')
-rw-r--r--src/program.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/program.rs b/src/program.rs
index d78fa505..3a16ea29 100644
--- a/src/program.rs
+++ b/src/program.rs
@@ -107,7 +107,7 @@ where
type Theme = crate::Theme;
type Executor = iced_futures::backend::null::Executor;
- fn new(&self) -> (Self::State, Command<Self::Message>) {
+ fn build(&self) -> (Self::State, Command<Self::Message>) {
(State::default(), Command::none())
}
@@ -176,7 +176,7 @@ where
type Theme = crate::Theme;
type Executor = executor::Default;
- fn new(&self) -> (Self::State, Command<Self::Message>) {
+ fn build(&self) -> (Self::State, Command<Self::Message>) {
(self.new)()
}
@@ -240,7 +240,7 @@ impl<P: Definition> Program<P> {
type Executor = P::Executor;
fn new(program: Self::Flags) -> (Self, Command<Self::Message>) {
- let (state, command) = P::new(&program);
+ let (state, command) = P::build(&program);
(Self { program, state }, command)
}
@@ -414,7 +414,7 @@ pub trait Definition: Sized {
/// The executor of the program.
type Executor: Executor;
- fn new(&self) -> (Self::State, Command<Self::Message>);
+ fn build(&self) -> (Self::State, Command<Self::Message>);
fn update(
&self,
@@ -462,8 +462,8 @@ fn with_title<P: Definition>(
type Theme = P::Theme;
type Executor = P::Executor;
- fn new(&self) -> (Self::State, Command<Self::Message>) {
- self.program.new()
+ fn build(&self) -> (Self::State, Command<Self::Message>) {
+ self.program.build()
}
fn title(&self, state: &Self::State) -> String {
@@ -525,8 +525,8 @@ fn with_subscription<P: Definition>(
(self.subscription)(state)
}
- fn new(&self) -> (Self::State, Command<Self::Message>) {
- self.program.new()
+ fn build(&self) -> (Self::State, Command<Self::Message>) {
+ self.program.build()
}
fn update(
@@ -581,8 +581,8 @@ fn with_theme<P: Definition>(
(self.theme)(state)
}
- fn new(&self) -> (Self::State, Command<Self::Message>) {
- self.program.new()
+ fn build(&self) -> (Self::State, Command<Self::Message>) {
+ self.program.build()
}
fn title(&self, state: &Self::State) -> String {