Skip to content

Commit 64048d4

Browse files
olsonjefferybrson
authored andcommitted
std: makeing uv::ll::listen/accept use generic params for ptr args
more flexibility..
1 parent 83cca50 commit 64048d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libstd/uv_ll.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,15 @@ unsafe fn tcp_bind(tcp_server_ptr: *uv_tcp_t,
637637
addr_ptr);
638638
}
639639

640-
unsafe fn listen(stream: *libc::c_void, backlog: libc::c_int,
640+
unsafe fn listen<T>(stream: *T, backlog: libc::c_int,
641641
cb: *u8) -> libc::c_int {
642-
ret rustrt::rust_uv_listen(stream, backlog, cb);
642+
ret rustrt::rust_uv_listen(stream as *libc::c_void, backlog, cb);
643643
}
644644

645-
unsafe fn accept(server: *libc::c_void, client: *libc::c_void)
645+
unsafe fn accept<T, U>(server: *T, client: *T)
646646
-> libc::c_int {
647-
ret rustrt::rust_uv_accept(server, client);
647+
ret rustrt::rust_uv_accept(server as *libc::c_void,
648+
client as *libc::c_void);
648649
}
649650

650651
unsafe fn write<T>(req: *uv_write_t, stream: *T,

0 commit comments

Comments
 (0)