Skip to content

Commit c166c67

Browse files
committed
fix: prevent copy tests from failing in Rust 1.90
Issue where changed: rust-lang/rust#139956 Comment noting breakage of non-socket converted to UnixStream: 'rust-lang/rust#140005 (comment)' Bumps MSRV from 1.83.0 to 1.87.0 by use of PipeWriter
1 parent af33f7e commit c166c67

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rustix = "0.38.31"
1212
all = "deny"
1313

1414
[workspace.package]
15-
rust-version = "1.83.0"
15+
rust-version = "1.87.0"
1616

1717
[package]
1818
name = "xwayland-satellite"

testwl/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::collections::{hash_map, HashMap, HashSet};
22
use std::io::Read;
3-
use std::io::Write;
3+
use std::io::{PipeWriter, Write};
44
use std::os::fd::{AsFd, BorrowedFd, OwnedFd};
55
use std::os::unix::net::UnixStream;
66
use std::sync::{Arc, Mutex, OnceLock};
@@ -1134,7 +1134,7 @@ impl Dispatch<ZwpPrimarySelectionOfferV1, Vec<PasteData>> for State {
11341134
.position(|data| data.mime_type == mime_type)
11351135
.unwrap_or_else(|| panic!("Invalid mime type: {mime_type}"));
11361136

1137-
let mut stream = UnixStream::from(fd);
1137+
let mut stream = PipeWriter::from(fd);
11381138
stream.write_all(&data[pos].data).unwrap();
11391139
}
11401140
Request::Destroy => {}
@@ -1219,7 +1219,7 @@ impl Dispatch<WlDataOffer, Vec<PasteData>> for State {
12191219
.position(|data| data.mime_type == mime_type)
12201220
.unwrap_or_else(|| panic!("Invalid mime type: {mime_type}"));
12211221

1222-
let mut stream = UnixStream::from(fd);
1222+
let mut stream = PipeWriter::from(fd);
12231223
stream.write_all(&data[pos].data).unwrap();
12241224
}
12251225
wl_data_offer::Request::Destroy => {}

0 commit comments

Comments
 (0)