Hide implementation details of Command in iced_futures

This commit is contained in:
Héctor Ramón Jiménez 2021-09-02 15:50:00 +07:00
parent 7a335a0408
commit 6fce35393f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 125 additions and 84 deletions

View file

@ -62,10 +62,10 @@ impl iced_native::Clipboard for Clipboard {
pub fn read<Message>(
f: impl Fn(Option<String>) -> Message + 'static,
) -> Command<Message> {
Command::Single(command::Action::Clipboard(Action::Read(Box::new(f))))
Command::single(command::Action::Clipboard(Action::Read(Box::new(f))))
}
/// Write the given contents to the clipboard.
pub fn write<Message>(contents: String) -> Command<Message> {
Command::Single(command::Action::Clipboard(Action::Write(contents)))
Command::single(command::Action::Clipboard(Action::Write(contents)))
}