Skip to content

Commit bf11145

Browse files
committed
self-review fixes
1 parent 812404f commit bf11145

File tree

13 files changed

+15
-128
lines changed

13 files changed

+15
-128
lines changed

Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ wasmer-it = { package = "wasmer-interface-types-fl", version = "0.27.0" }
2525
it-lilo = "0.6.0"
2626
it-memory-traits = "0.4.0"
2727
bytesize = "1.2.0"
28-
async-trait = "0.1.73"
2928
futures = "0.3.29"
3029

3130
multimap = "0.8.3"

core/src/host_imports/lowering/lo_helper.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
use super::AllocateFunc;
18-
//use crate::call_wasm_func;
1918

2019
use marine_wasm_backend_traits::DelayedContextLifetime;
2120
use marine_wasm_backend_traits::WasmBackend;
@@ -31,22 +30,20 @@ use futures::FutureExt;
3130
use std::marker::PhantomData;
3231

3332
pub(crate) struct LoHelper<
34-
'c,
3533
WB: WasmBackend,
3634
MV: MemoryView<DelayedContextLifetime<WB>>,
3735
M: Memory<MV, DelayedContextLifetime<WB>>,
3836
> {
3937
allocate_func: AllocateFunc<WB>,
4038
memory: M,
41-
_memory_view_phantom: PhantomData<(MV, &'c i32)>,
39+
_memory_view_phantom: PhantomData<MV>,
4240
}
4341

4442
impl<
45-
'c,
4643
WB: WasmBackend,
4744
MV: MemoryView<DelayedContextLifetime<WB>>,
4845
M: Memory<MV, DelayedContextLifetime<WB>>,
49-
> LoHelper<'c, WB, MV, M>
46+
> LoHelper<WB, MV, M>
5047
{
5148
pub(crate) fn new(allocate_func: AllocateFunc<WB>, memory: M) -> Self {
5249
Self {
@@ -58,11 +55,10 @@ impl<
5855
}
5956

6057
impl<
61-
's,
6258
WB: WasmBackend,
6359
MV: MemoryView<DelayedContextLifetime<WB>>,
6460
M: Memory<MV, DelayedContextLifetime<WB>>,
65-
> Allocatable<MV, DelayedContextLifetime<WB>> for LoHelper<'s, WB, MV, M>
61+
> Allocatable<MV, DelayedContextLifetime<WB>> for LoHelper<WB, MV, M>
6662
{
6763
fn allocate<'this, 'ctx1: 'this, 'ctx2: 'ctx1>(
6864
&'this mut self,

core/src/host_imports/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ use marine_wasm_backend_traits::WValue;
2929
use marine_wasm_backend_traits::WType;
3030

3131
type HostImportResult<T> = std::result::Result<T, HostImportError>;
32-
/*type WasmModuleFunc<WB, Args, Rets> = Box<
33-
dyn FnMut(&mut <WB as WasmBackend>::ContextMut<'_>, Args) -> RuntimeResult<Rets> + Sync + Send,
34-
>;*/
3532
type AllocateFunc<WB> = TypedFunc<WB, (i32, i32), i32>;
3633

3734
const ALLOCATE_FUNC_NAME: &str = "allocate";

core/src/module/marine_module.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,6 @@ impl<WB: WasmBackend> Callable<WB> {
8585
.to_owned();
8686
Ok(result)
8787
}
88-
/*
89-
pub async fn call_async(
90-
&mut self,
91-
store: &mut <WB as WasmBackend>::ContextMut<'_>,
92-
args: &[IValue],
93-
) -> MResult<Vec<IValue>> {
94-
use wasmer_it::interpreter::stack::Stackable;
95-
96-
let result = self
97-
.it_module_func
98-
.interpreter
99-
.run(args, Arc::make_mut(&mut self.it_instance), store).await?
100-
.as_slice()
101-
.to_owned();
102-
103-
Ok(result)
104-
}*/
10588
}
10689

10790
type ExportFunctions<WB> = HashMap<SharedString, Arc<Callable<WB>>>;
@@ -396,10 +379,6 @@ impl<WB: WasmBackend> MModule<WB> {
396379
let wit_instance = wit_instance.clone();
397380
let interpreter = interpreter.clone();
398381
async move {
399-
/* let import_namespace = import_namespace.clone();
400-
let import_name = import_name.clone();
401-
let wit_instance = wit_instance.clone();
402-
let interpreter = interpreter.clone();*/
403382
let mut ctx = ctx.as_context_mut();
404383

405384
use wasmer_it::interpreter::stack::Stackable;

crates/fluence-app-service/src/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use super::AppServiceError;
2222

2323
#[cfg(feature = "raw-module-api")]
2424
use marine_wasm_backend_traits::WasiState;
25-
use marine_wasm_backend_traits::{WasmBackend};
26-
use marine::{Marine};
25+
use marine_wasm_backend_traits::WasmBackend;
26+
use marine::Marine;
2727
use marine::MarineModuleConfig;
2828
use marine::IValue;
2929

crates/js-backend/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ log = "0.4.20"
2222
typed-index-collections = "3.1.0"
2323
derive_more = "0.99.17"
2424
wasmparser = "0.110.0"
25-
async-trait = "0.1.74"
26-
futures = "0.3.29"
25+
futures = "0.3.29"

crates/wasm-backend-traits/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ anyhow = "1.0.75"
1515
wasmparser = "0.101.1"
1616
paste = "1.0.14"
1717
multimap = "0.8.3"
18-
async-trait = "0.1.71"
19-
futures = "0.3.29"
18+
futures = "0.3.29"

crates/wasm-backend-traits/src/function.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
use std::future::Future;
1817
use crate::AsContextMut;
1918
use crate::FuncSig;
2019
use crate::impl_for_each_function_signature;
@@ -24,6 +23,8 @@ use crate::WValue;
2423

2524
use futures::future::BoxFuture;
2625

26+
use std::future::Future;
27+
2728
/// A host function ready to be used as an import for instantiating a module.
2829
/// As it is only a handle to an object in `Store`, cloning is cheap.
2930
pub trait HostFunction<WB: WasmBackend>: AsyncFunction<WB> + Send + Sync + Clone {

crates/wasm-backend-traits/src/imports.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use crate::AsContext;
2020
use crate::WasmBackend;
2121
use crate::WType;
2222

23+
use futures::future::BoxFuture;
24+
2325
use std::borrow::Cow;
2426
use std::fmt::Formatter;
25-
use std::future::Future;
2627
use std::sync::Arc;
27-
use futures::future::BoxFuture;
2828

2929
/// A "Linker" object, that is used to match functions with module imports during instantiation.
3030
/// Cloning is a cheap operation for this object. All clones refer to the same data in store.

0 commit comments

Comments
 (0)