Skip to content

Commit 96f0083

Browse files
author
Pat Hickey
authored
Minor preview2 impl cleanups (bytecodealliance#7097)
* delete preview2::pipe::pipe this is not used anywhere, not documented, and trivial for the user to build on their own if they need it. i suspect they probably only want one end of their pipe wrapped with AsyncReadStream or AsyncWriteStream. * fix cfg_attr to ignore forking tests on qemu * delete "async fd stdin" test, which is just the worker thread one anyway
1 parent 3cdc63b commit 96f0083

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

crates/wasi/src/preview2/pipe.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,6 @@ impl HostOutputStream for MemoryOutputPipe {
105105
}
106106
}
107107

108-
/// FIXME: this needs docs
109-
pub fn pipe(size: usize) -> (AsyncReadStream, AsyncWriteStream) {
110-
let (a, b) = tokio::io::duplex(size);
111-
let (_read_half, write_half) = tokio::io::split(a);
112-
let (read_half, _write_half) = tokio::io::split(b);
113-
(
114-
AsyncReadStream::new(read_half),
115-
AsyncWriteStream::new(size, write_half),
116-
)
117-
}
118-
119108
/// Provides a [`HostInputStream`] impl from a [`tokio::io::AsyncRead`] impl
120109
pub struct AsyncReadStream {
121110
state: StreamState,

crates/wasi/src/preview2/stdio.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,7 @@ mod test {
333333

334334
// This test doesn't work under qemu because of the use of fork in the test helper.
335335
#[test]
336-
#[cfg_attr(not(target = "x86_64"), ignore)]
337-
fn test_async_fd_stdin() {
338-
test_stdin_by_forking(super::stdin);
339-
}
340-
341-
// This test doesn't work under qemu because of the use of fork in the test helper.
342-
#[test]
343-
#[cfg_attr(not(target = "x86_64"), ignore)]
336+
#[cfg_attr(not(target_arch = "x86_64"), ignore)]
344337
fn test_worker_thread_stdin() {
345338
test_stdin_by_forking(super::worker_thread_stdin::stdin);
346339
}

0 commit comments

Comments
 (0)