Handle clipboard::Action in iced_winit shell

This commit is contained in:
Héctor Ramón Jiménez 2021-09-02 13:46:01 +07:00
parent 76698ff2b5
commit c9711ff48f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 57 additions and 17 deletions

View file

@ -24,7 +24,7 @@ impl Clipboard for Null {
pub enum Action<T> {
Read(Box<dyn Fn(Option<String>) -> T>),
Write(Box<dyn Fn(String) -> T>),
Write(String),
}
impl<T> Action<T> {
@ -34,7 +34,7 @@ impl<T> Action<T> {
{
match self {
Self::Read(o) => Action::Read(Box::new(move |s| f(o(s)))),
Self::Write(o) => Action::Write(Box::new(move |s| f(o(s)))),
Self::Write(content) => Action::Write(content),
}
}
}