Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottt committed Jun 28, 2024
1 parent ba3a765 commit 7000ec3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions crates/adapter/src/descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ impl Streams {

pub enum StreamType {
/// Streams for implementing stdio.
Stdio(Stdio),
}

pub enum Stdio {
Stdin,
Stdout,
Stderr,
Stdio,
}

#[repr(C)]
Expand Down Expand Up @@ -94,19 +88,19 @@ impl Descriptors {
d.push(Descriptor::Streams(Streams {
input: new_once(stdin::get_stdin()),
output: OnceCell::new(),
type_: StreamType::Stdio(Stdio::Stdin),
type_: StreamType::Stdio,
}))
.trapping_unwrap();
d.push(Descriptor::Streams(Streams {
input: OnceCell::new(),
output: new_once(stdout::get_stdout()),
type_: StreamType::Stdio(Stdio::Stdout),
type_: StreamType::Stdio,
}))
.trapping_unwrap();
d.push(Descriptor::Streams(Streams {
input: OnceCell::new(),
output: new_once(stderr::get_stderr()),
type_: StreamType::Stdio(Stdio::Stderr),
type_: StreamType::Stdio,
}))
.trapping_unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/adapter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ pub unsafe extern "C" fn poll_oneoff(
.trapping_unwrap();
match desc {
Descriptor::Streams(streams) => match &streams.type_ {
StreamType::Stdio(_) => (ERRNO_SUCCESS, 1, 0),
StreamType::Stdio => (ERRNO_SUCCESS, 1, 0),
},
_ => unreachable!(),
}
Expand All @@ -1163,7 +1163,7 @@ pub unsafe extern "C" fn poll_oneoff(
.trapping_unwrap();
match desc {
Descriptor::Streams(streams) => match &streams.type_ {
StreamType::Stdio(_) => (ERRNO_SUCCESS, 1, 0),
StreamType::Stdio => (ERRNO_SUCCESS, 1, 0),
},
_ => unreachable!(),
}
Expand Down
Binary file modified lib/data/viceroy-component-adapter.wasm
Binary file not shown.

0 comments on commit 7000ec3

Please sign in to comment.