@@ -9,7 +9,7 @@ use std::{env, fs};
9
9
use wasm_encoder:: { Encode , Section } ;
10
10
use wasmtime:: component:: { Component , Instance , Linker , ResourceTable } ;
11
11
use wasmtime:: { Config , Engine , Store , Table } ;
12
- use wasmtime_wasi:: preview2 :: { WasiCtx , WasiCtxBuilder , WasiView } ;
12
+ use wasmtime_wasi:: { WasiCtx , WasiCtxBuilder , WasiView } ;
13
13
use wit_component:: { ComponentEncoder , StringEncoding } ;
14
14
use wit_parser:: { Resolve , WorldId , WorldItem } ;
15
15
@@ -46,16 +46,10 @@ struct Wasi<T: Send>(T, MyCtx, ResourceTable, WasiCtx);
46
46
47
47
// wasi trait
48
48
impl < T : Send > WasiView for Wasi < T > {
49
- fn table ( & self ) -> & ResourceTable {
50
- & self . 2
51
- }
52
- fn table_mut ( & mut self ) -> & mut ResourceTable {
49
+ fn table ( & mut self ) -> & mut ResourceTable {
53
50
& mut self . 2
54
51
}
55
- fn ctx ( & self ) -> & WasiCtx {
56
- & self . 3
57
- }
58
- fn ctx_mut ( & mut self ) -> & mut WasiCtx {
52
+ fn ctx ( & mut self ) -> & mut WasiCtx {
59
53
& mut self . 3
60
54
}
61
55
}
@@ -106,7 +100,7 @@ where
106
100
107
101
let mut store = Store :: new ( & engine, data) ;
108
102
109
- wasmtime_wasi:: preview2 :: command:: sync:: add_to_linker ( & mut linker) ?;
103
+ wasmtime_wasi:: command:: sync:: add_to_linker ( & mut linker) ?;
110
104
111
105
let ( exports, _) = instantiate ( & mut store, & component, & linker) ?;
112
106
0 commit comments