Fix crash when receiving non-utf8 data

This commit also changes return type of `load` and `load_primary`
to propagate errors during reading and parsing clipboard contents.
This commit is contained in:
Kirill Chibisov 2020-03-04 22:03:55 +03:00
parent 9855d34e4a
commit 2971386aea
3 changed files with 33 additions and 21 deletions

View file

@ -37,7 +37,7 @@ fn main() {
} = event
{
if text == " " {
*cb_contents_clone.lock().unwrap() = dbg!(clipboard.load(None));
*cb_contents_clone.lock().unwrap() = dbg!(clipboard.load(None).unwrap());
need_redraw_clone.store(true, atomic::Ordering::Relaxed)
} else if text == "s" {
clipboard.store(