From 5a986897d22f6d79a7a1fbaa4f3d1aaa1f9ca3bb Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 16 Mar 2024 05:47:01 +0100 Subject: Rename `Program::new` to `build` --- src/program.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') 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) { + fn build(&self) -> (Self::State, Command) { (State::default(), Command::none()) } @@ -176,7 +176,7 @@ where type Theme = crate::Theme; type Executor = executor::Default; - fn new(&self) -> (Self::State, Command) { + fn build(&self) -> (Self::State, Command) { (self.new)() } @@ -240,7 +240,7 @@ impl Program

{ type Executor = P::Executor; fn new(program: Self::Flags) -> (Self, Command) { - 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); + fn build(&self) -> (Self::State, Command); fn update( &self, @@ -462,8 +462,8 @@ fn with_title( type Theme = P::Theme; type Executor = P::Executor; - fn new(&self) -> (Self::State, Command) { - self.program.new() + fn build(&self) -> (Self::State, Command) { + self.program.build() } fn title(&self, state: &Self::State) -> String { @@ -525,8 +525,8 @@ fn with_subscription( (self.subscription)(state) } - fn new(&self) -> (Self::State, Command) { - self.program.new() + fn build(&self) -> (Self::State, Command) { + self.program.build() } fn update( @@ -581,8 +581,8 @@ fn with_theme( (self.theme)(state) } - fn new(&self) -> (Self::State, Command) { - self.program.new() + fn build(&self) -> (Self::State, Command) { + self.program.build() } fn title(&self, state: &Self::State) -> String { -- cgit