Handle clipboard::Action in iced_winit shell
This commit is contained in:
parent
76698ff2b5
commit
c9711ff48f
5 changed files with 57 additions and 17 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue