xstate: always advertise utf8 mime type as UTF8_STRING from Wayland selection

Fixes #87
This commit is contained in:
Shawn Wallace 2025-01-10 00:36:02 -05:00
parent ba9c1a6a3e
commit 8f55e27f63
3 changed files with 92 additions and 3 deletions

View file

@ -875,7 +875,7 @@ impl Dispatch<WlDataOffer, Vec<PasteData>> for State {
let pos = data
.iter()
.position(|data| data.mime_type == mime_type)
.expect("Invalid mime type: {mime_type}");
.unwrap_or_else(|| panic!("Invalid mime type: {mime_type}"));
let mut stream = UnixStream::from(fd);
stream.write_all(&data[pos].data).unwrap();