Implement write support for clipboard_x11

This commit is contained in:
Héctor Ramón Jiménez 2021-03-06 04:34:02 +01:00
parent aeda90d4ef
commit a97dfae8f6
11 changed files with 496 additions and 185 deletions

View file

@ -27,10 +27,18 @@ impl ClipboardProvider for wayland::Clipboard {
fn read(&self) -> Result<String, Box<dyn Error>> {
self.read()
}
fn write(&mut self, contents: String) -> Result<(), Box<dyn Error>> {
self.write(contents)
}
}
impl ClipboardProvider for x11::Clipboard {
fn read(&self) -> Result<String, Box<dyn Error>> {
self.read()
self.read().map_err(Box::from)
}
fn write(&mut self, contents: String) -> Result<(), Box<dyn Error>> {
self.write(contents).map_err(Box::from)
}
}