diff options
author | 2024-07-05 01:13:28 +0200 | |
---|---|---|
committer | 2024-07-05 01:13:28 +0200 | |
commit | 88611d7653e2a22c82c41f8d1a4732c2af60adcd (patch) | |
tree | 0aa1b73fc5163d58eee2b6c74f0566deeb7ce60c /runtime/src/clipboard.rs | |
parent | 2b19471d1cfe4cf034b026aa6620b1685a5ab772 (diff) | |
download | iced-88611d7653e2a22c82c41f8d1a4732c2af60adcd.tar.gz iced-88611d7653e2a22c82c41f8d1a4732c2af60adcd.tar.bz2 iced-88611d7653e2a22c82c41f8d1a4732c2af60adcd.zip |
Hide internal `Task` constructors
Diffstat (limited to 'runtime/src/clipboard.rs')
-rw-r--r-- | runtime/src/clipboard.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/src/clipboard.rs b/runtime/src/clipboard.rs index 19950d01..a02cc011 100644 --- a/runtime/src/clipboard.rs +++ b/runtime/src/clipboard.rs @@ -1,7 +1,7 @@ //! Access the clipboard. use crate::core::clipboard::Kind; use crate::futures::futures::channel::oneshot; -use crate::Task; +use crate::task::{self, Task}; /// A clipboard action to be performed by some [`Task`]. /// @@ -27,7 +27,7 @@ pub enum Action { /// Read the current contents of the clipboard. pub fn read() -> Task<Option<String>> { - Task::oneshot(|channel| { + task::oneshot(|channel| { crate::Action::Clipboard(Action::Read { target: Kind::Standard, channel, @@ -37,7 +37,7 @@ pub fn read() -> Task<Option<String>> { /// Read the current contents of the primary clipboard. pub fn read_primary() -> Task<Option<String>> { - Task::oneshot(|channel| { + task::oneshot(|channel| { crate::Action::Clipboard(Action::Read { target: Kind::Primary, channel, @@ -47,7 +47,7 @@ pub fn read_primary() -> Task<Option<String>> { /// Write the given contents to the clipboard. pub fn write<T>(contents: String) -> Task<T> { - Task::effect(crate::Action::Clipboard(Action::Write { + task::effect(crate::Action::Clipboard(Action::Write { target: Kind::Standard, contents, })) @@ -55,7 +55,7 @@ pub fn write<T>(contents: String) -> Task<T> { /// Write the given contents to the primary clipboard. pub fn write_primary<Message>(contents: String) -> Task<Message> { - Task::effect(crate::Action::Clipboard(Action::Write { + task::effect(crate::Action::Clipboard(Action::Write { target: Kind::Primary, contents, })) |