From a803ab240b9b5d1a073454f814229bad9d8bdafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Mon, 18 Nov 2019 00:10:40 +0100 Subject: [PATCH] Rename `Command::attempt` to `Command::perform` --- core/src/command.rs | 2 +- examples/todos.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/command.rs b/core/src/command.rs index ae901bd8..e1c865dd 100644 --- a/core/src/command.rs +++ b/core/src/command.rs @@ -11,7 +11,7 @@ impl Command { } } - pub fn attempt( + pub fn perform( future: impl Future + 'static + Send, f: impl Fn(T) -> A + 'static + Send, ) -> Command { diff --git a/examples/todos.rs b/examples/todos.rs index 2cdf1ea1..05142fb2 100644 --- a/examples/todos.rs +++ b/examples/todos.rs @@ -41,7 +41,7 @@ impl Application for Todos { type Message = Message; fn new() -> (Todos, Command) { - (Todos::Loading, Command::attempt(load(), Message::Loaded)) + (Todos::Loading, Command::perform(load(), Message::Loaded)) } fn title(&self) -> String { @@ -114,7 +114,7 @@ impl Application for Todos { state.dirty = false; state.saving = true; - Command::attempt( + Command::perform( save(SavedState { input_value: state.input_value.clone(), filter: state.filter,