From d6cb6ceee78630a95521e92f652a0da7f81422e7 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Mon, 2 Oct 2023 18:37:34 -0700 Subject: [PATCH] Fix a regression with `wasmtime serve`, and enable the serve feature in tests --- ci/run-tests.sh | 1 + src/commands/serve.rs | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ci/run-tests.sh b/ci/run-tests.sh index b29b6eb71d9b..568ff4405413 100755 --- a/ci/run-tests.sh +++ b/ci/run-tests.sh @@ -5,6 +5,7 @@ cargo test \ --features wasi-threads \ --features wasi-http \ --features component-model \ + --features serve \ --workspace \ --exclude 'wasmtime-wasi-*' \ --exclude wasi-tests \ diff --git a/src/commands/serve.rs b/src/commands/serve.rs index 5cd1a8225e4c..3f69a3d75cef 100644 --- a/src/commands/serve.rs +++ b/src/commands/serve.rs @@ -14,14 +14,12 @@ struct Host { } impl Host { - fn new() -> Result { - let mut table = Table::new(); - let ctx = WasiCtxBuilder::new().build(&mut table)?; - Ok(Host { - table, - ctx, + fn new() -> Self { + Host { + table: Table::new(), + ctx: WasiCtxBuilder::new().build(), http: WasiHttpCtx, - }) + } } }