Rename Command::attempt to Command::perform

This commit is contained in:
Héctor Ramón Jiménez 2019-11-18 00:10:40 +01:00
parent b2392d28bd
commit a803ab240b
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ impl<T> Command<T> {
} }
} }
pub fn attempt<A>( pub fn perform<A>(
future: impl Future<Output = T> + 'static + Send, future: impl Future<Output = T> + 'static + Send,
f: impl Fn(T) -> A + 'static + Send, f: impl Fn(T) -> A + 'static + Send,
) -> Command<A> { ) -> Command<A> {

View File

@ -41,7 +41,7 @@ impl Application for Todos {
type Message = Message; type Message = Message;
fn new() -> (Todos, Command<Message>) { fn new() -> (Todos, Command<Message>) {
(Todos::Loading, Command::attempt(load(), Message::Loaded)) (Todos::Loading, Command::perform(load(), Message::Loaded))
} }
fn title(&self) -> String { fn title(&self) -> String {
@ -114,7 +114,7 @@ impl Application for Todos {
state.dirty = false; state.dirty = false;
state.saving = true; state.saving = true;
Command::attempt( Command::perform(
save(SavedState { save(SavedState {
input_value: state.input_value.clone(), input_value: state.input_value.clone(),
filter: state.filter, filter: state.filter,