Skip to content

Commit 0548722

Browse files
committed
fix(driver,unix): type param of AcceptMulti::result
1 parent edd80c4 commit 0548722

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

compio-driver/src/sys/unix_op.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,14 @@ impl<S> AcceptMulti<S> {
573573
}
574574
}
575575

576-
impl<S: FromRawFd> AcceptMulti<S> {
576+
impl AcceptMulti<()> {
577577
/// Get the accepted socket.
578578
///
579579
/// # Safety
580580
///
581581
/// The `result` must be the result of this operation.
582-
pub unsafe fn result(result: io::Result<usize>) -> io::Result<S> {
583-
result.map(|fd| unsafe { S::from_raw_fd(fd as _) })
582+
pub unsafe fn result<T: FromRawFd>(result: io::Result<usize>) -> io::Result<T> {
583+
result.map(|fd| unsafe { T::from_raw_fd(fd as _) })
584584
}
585585
}
586586

compio-driver/tests/op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ fn accept_multi() {
371371
loop {
372372
let op = AcceptMulti::new(server.clone());
373373
for BufResult(res, _) in push_and_wait_multi(&mut driver, op) {
374-
let mut client = unsafe { AcceptMulti::<socket2::Socket>::result(res).unwrap() };
374+
let mut client = unsafe { AcceptMulti::result::<socket2::Socket>(res).unwrap() };
375375
client
376376
.write_all(format!("Hello, {}", i).as_bytes())
377377
.unwrap();

0 commit comments

Comments
 (0)