Skip to content

Commit

Permalink
component runtime: refactor HostState::new
Browse files Browse the repository at this point in the history
  • Loading branch information
CLEMENTINATOR committed Feb 16, 2025
1 parent 3c94837 commit cabb7ee
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/components-runtime/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,15 @@ pub struct HostState {

impl HostState {
fn new() -> Self {
let ctx = WasiCtx::builder().build();

let table = ResourceTable::new();

Self { ctx, table }
Self::new_with_ctx(WasiCtx::builder().build())
}

fn new_with_stdout() -> Self {
let ctx = WasiCtx::builder().inherit_stdout().build();
Self::new_with_ctx(WasiCtx::builder().inherit_stdout().build())
}

fn new_with_ctx(ctx: WasiCtx) -> Self {
let table = ResourceTable::new();

Self { ctx, table }
}
}
Expand Down

0 comments on commit cabb7ee

Please sign in to comment.