Skip to content

Commit a96973e

Browse files
committed
Resolve more compile errors and clippy lints
Signed-off-by: Alex Crichton <[email protected]>
1 parent af1d693 commit a96973e

File tree

12 files changed

+12
-31
lines changed

12 files changed

+12
-31
lines changed

crates/componentize/src/abi_conformance/test_config.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
use super::{config, Context, TestConfig};
22
use anyhow::{ensure, Result};
33
use std::collections::HashMap;
4-
use wasmtime::{
5-
component::{InstancePre, __internal::async_trait},
6-
Engine,
7-
};
4+
use wasmtime::{component::InstancePre, Engine};
85

96
#[derive(Default)]
107
pub(super) struct Config {
118
map: HashMap<String, String>,
129
}
1310

14-
#[async_trait]
1511
impl config::Host for Config {
1612
async fn get_config(&mut self, key: String) -> Result<Result<String, config::Error>> {
1713
Ok(self

crates/componentize/src/abi_conformance/test_http.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use super::{
44
Context, TestConfig,
55
};
66
use anyhow::{ensure, Result};
7-
use async_trait::async_trait;
87
use std::collections::HashMap;
98
use wasmtime::{component::InstancePre, Engine};
109

@@ -13,7 +12,6 @@ pub(crate) struct Http {
1312
map: HashMap<String, String>,
1413
}
1514

16-
#[async_trait]
1715
impl http::Host for Http {
1816
async fn send_request(&mut self, req: Request) -> Result<Result<Response, HttpError>> {
1917
Ok(self

crates/componentize/src/abi_conformance/test_key_value.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use super::{
33
Context, TestConfig,
44
};
55
use anyhow::{anyhow, ensure, Result};
6-
use async_trait::async_trait;
76
use serde::Serialize;
87
use std::{
98
collections::{HashMap, HashSet},
@@ -34,7 +33,6 @@ pub(crate) struct KeyValue {
3433
close_set: HashSet<KvStore>,
3534
}
3635

37-
#[async_trait]
3836
impl key_value::Host for KeyValue {
3937
async fn open(&mut self, name: String) -> Result<Result<KvStore, Error>> {
4038
Ok(self.open_map.remove(&name).ok_or_else(|| {

crates/componentize/src/abi_conformance/test_llm.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::collections::HashMap;
22

33
use anyhow::{ensure, Result};
4-
use async_trait::async_trait;
54
use serde::Serialize;
65

76
use super::llm;
@@ -18,7 +17,6 @@ pub struct Llm {
1817
embeddings: HashMap<(String, Vec<String>), Vec<Vec<f32>>>,
1918
}
2019

21-
#[async_trait]
2220
impl llm::Host for Llm {
2321
async fn infer(
2422
&mut self,

crates/componentize/src/abi_conformance/test_mysql.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use super::{
44
Context, TestConfig,
55
};
66
use anyhow::{ensure, Result};
7-
use async_trait::async_trait;
87
use serde::Serialize;
98
use std::{
109
collections::{HashMap, HashSet},
@@ -40,7 +39,6 @@ pub(crate) struct Mysql {
4039
query_map: HashMap<(String, String, String), RowSet>,
4140
}
4241

43-
#[async_trait]
4442
impl mysql::Host for Mysql {
4543
async fn execute(
4644
&mut self,

crates/componentize/src/abi_conformance/test_postgres.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use super::{
44
Context, TestConfig,
55
};
66
use anyhow::{ensure, Result};
7-
use async_trait::async_trait;
87
use serde::Serialize;
98
use std::{collections::HashMap, iter};
109
use wasmtime::{component::InstancePre, Engine};
@@ -37,7 +36,6 @@ pub(crate) struct Postgres {
3736
query_map: HashMap<(String, String, String), RowSet>,
3837
}
3938

40-
#[async_trait]
4139
impl postgres::Host for Postgres {
4240
async fn execute(
4341
&mut self,

crates/componentize/src/abi_conformance/test_redis.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use super::{
33
Context, TestConfig,
44
};
55
use anyhow::{ensure, Result};
6-
use async_trait::async_trait;
76
use serde::Serialize;
87
use std::collections::{HashMap, HashSet};
98
use wasmtime::{component::InstancePre, Engine};
@@ -103,7 +102,6 @@ pub(crate) struct Redis {
103102
execute_map: HashMap<(String, String, Vec<Vec<u8>>), Vec<RedisResult>>,
104103
}
105104

106-
#[async_trait]
107105
impl redis::Host for Redis {
108106
async fn publish(
109107
&mut self,

crates/factor-key-value/src/host.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ impl wasi_keyvalue::store::HostBucket for KeyValueDispatch {
279279

280280
impl wasi_keyvalue::batch::Host for KeyValueDispatch {
281281
#[instrument(name = "spin_key_value.get_many", skip(self, bucket, keys), err(level = Level::INFO), fields(otel.kind = "client"))]
282+
#[allow(clippy::type_complexity)]
282283
async fn get_many(
283284
&mut self,
284285
bucket: Resource<wasi_keyvalue::batch::Bucket>,

crates/factor-outbound-mysql/src/host.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
5959
statement: String,
6060
params: Vec<ParameterValue>,
6161
) -> Result<(), v2::Error> {
62-
Ok(self
63-
.get_client(connection)
62+
self.get_client(connection)
6463
.await?
6564
.execute(statement, params)
66-
.await?)
65+
.await
6766
}
6867

6968
#[instrument(name = "spin_outbound_mysql.query", skip(self, connection, params), err(level = Level::INFO), fields(otel.kind = "client", db.system = "mysql", otel.name = statement))]
@@ -73,11 +72,10 @@ impl<C: Client> v2::HostConnection for InstanceState<C> {
7372
statement: String,
7473
params: Vec<ParameterValue>,
7574
) -> Result<v2_types::RowSet, v2::Error> {
76-
Ok(self
77-
.get_client(connection)
75+
self.get_client(connection)
7876
.await?
7977
.query(statement, params)
80-
.await?)
78+
.await
8179
}
8280

8381
async fn drop(&mut self, connection: Resource<Connection>) -> Result<()> {

crates/factor-outbound-pg/src/host.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,10 @@ impl<C: Send + Sync + Client> spin_world::spin::postgres::postgres::HostConnecti
9797
statement: String,
9898
params: Vec<v3::ParameterValue>,
9999
) -> Result<u64, v3::Error> {
100-
Ok(self
101-
.get_client(connection)
100+
self.get_client(connection)
102101
.await?
103102
.execute(statement, params)
104-
.await?)
103+
.await
105104
}
106105

107106
#[instrument(name = "spin_outbound_pg.query", skip(self, connection, params), err(level = Level::INFO), fields(otel.kind = "client", db.system = "postgresql", otel.name = statement))]
@@ -111,11 +110,10 @@ impl<C: Send + Sync + Client> spin_world::spin::postgres::postgres::HostConnecti
111110
statement: String,
112111
params: Vec<v3::ParameterValue>,
113112
) -> Result<v3::RowSet, v3::Error> {
114-
Ok(self
115-
.get_client(connection)
113+
self.get_client(connection)
116114
.await?
117115
.query(statement, params)
118-
.await?)
116+
.await
119117
}
120118

121119
async fn drop(&mut self, connection: Resource<v3::Connection>) -> anyhow::Result<()> {

0 commit comments

Comments
 (0)