Skip to content

Commit f9b7000

Browse files
committed
fix compilation for 2024 edition
1 parent fa2bc7b commit f9b7000

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/blocking/pty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Pty {
1818
/// The provided file descriptor must be valid, open, and belong to a pty.
1919
#[must_use]
2020
pub unsafe fn from_fd(fd: std::os::fd::OwnedFd) -> Self {
21-
Self(crate::sys::Pty::from_fd(fd))
21+
unsafe { Self(crate::sys::Pty::from_fd(fd)) }
2222
}
2323

2424
/// Change the terminal size associated with the pty.
@@ -93,7 +93,7 @@ impl Pts {
9393
/// child end of a pty.
9494
#[must_use]
9595
pub unsafe fn from_fd(fd: std::os::fd::OwnedFd) -> Self {
96-
Self(crate::sys::Pts::from_fd(fd))
96+
unsafe { Self(crate::sys::Pts::from_fd(fd)) }
9797
}
9898
}
9999

src/pty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ impl Pty {
3030
/// # Errors
3131
/// Returns an error if it fails to be registered with the async runtime.
3232
pub unsafe fn from_fd(fd: std::os::fd::OwnedFd) -> crate::Result<Self> {
33-
Ok(Self(tokio::io::unix::AsyncFd::new(
34-
crate::sys::Pty::from_fd(fd),
35-
)?))
33+
Ok(Self(tokio::io::unix::AsyncFd::new(unsafe {
34+
crate::sys::Pty::from_fd(fd)
35+
})?))
3636
}
3737

3838
/// Change the terminal size associated with the pty.
@@ -163,7 +163,7 @@ impl Pts {
163163
/// child end of a pty.
164164
#[must_use]
165165
pub unsafe fn from_fd(fd: std::os::fd::OwnedFd) -> Self {
166-
Self(crate::sys::Pts::from_fd(fd))
166+
Self(unsafe { crate::sys::Pts::from_fd(fd) })
167167
}
168168
}
169169

src/sys.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ impl Pts {
138138
))
139139
}
140140

141-
pub fn session_leader(&self) -> impl FnMut() -> std::io::Result<()> {
141+
pub fn session_leader(
142+
&self,
143+
) -> impl FnMut() -> std::io::Result<()> + use<> {
142144
let pts_fd = self.0.as_raw_fd();
143145
move || {
144146
rustix::process::setsid()?;

0 commit comments

Comments
 (0)