Skip to content

Commit 9d63573

Browse files
committed
Use async-io rather than smol
This removes a number of dependencies that need to be built for mctp-linux. smol internally uses async-io, so no change is expected. This updates to the latest async-io version 2.6.0 Some examples/tests in other crates are still using smol where they need additional features. Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
1 parent 1806579 commit 9d63573

16 files changed

Lines changed: 78 additions & 40 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repository = "https://github.com/CodeConstruct/mctp-rs"
1010
[workspace.dependencies]
1111
anyhow = "1.0.80"
1212
argh = "0.1.12"
13+
async-io = "2.6"
1314
chrono = { version = "0.4", default-features = false }
1415
crc = "3.3"
1516
defmt = "0.3"

mctp-estack/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ embedded-io-adapters = { workspace = true }
2626
env_logger = { workspace = true }
2727
futures = "0.3"
2828
proptest = { workspace = true }
29+
async-io = { workspace = true }
2930
smol = { workspace = true }
3031

3132

mctp-estack/tests/roundtrip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ where
101101
F: Future<Output = R>,
102102
{
103103
let pktloop = router_loop(routera, routerb);
104-
smol::block_on(async {
104+
async_io::block_on(async {
105105
select! {
106106
res = test.fuse() => {
107107
info!("Finished");

mctp-linux/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ categories = ["network-programming", "embedded", "hardware-support", "os::linux-
1010
[dependencies]
1111
libc = "0.2"
1212
mctp = { workspace = true, features = ["std"] }
13-
smol = { workspace = true }
13+
async-io = { workspace = true }
1414

1515
[[example]]
1616
name = "mctp-req"

mctp-linux/examples/async-req.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn main() -> std::io::Result<()> {
1616
let tx_buf = vec![0x02u8];
1717
let mut rx_buf = vec![0u8; 16];
1818

19-
let (typ, ic, rx_buf) = smol::block_on(async {
19+
let (typ, ic, rx_buf) = async_io::block_on(async {
2020
ep.send(MCTP_TYPE_CONTROL, &tx_buf).await?;
2121
ep.recv(&mut rx_buf).await
2222
})?;

mctp-linux/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
//! single-endpoint communication; general MCTP requesters may want a different
4040
//! socket model.
4141
42+
use async_io::Async;
4243
use core::mem;
43-
use smol::Async;
4444
use std::fmt;
4545
use std::io::Error;
4646
use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, OwnedFd, RawFd};

pldm-file/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ anyhow = "1.0"
2323
chrono = { workspace = true, features = ["clock"] }
2424
mctp-linux = { workspace = true }
2525
pldm-platform = { workspace = true, features = ["alloc"] }
26-
smol = "2.0"
26+
async-io = { workspace = true }
2727
env_logger = "0.11.3"
2828

2929
[features]

pldm-file/examples/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const EID: Eid = Eid(8);
1212
fn main() -> Result<()> {
1313
let mut req = MctpLinuxAsyncReq::new(EID, None)?;
1414

15-
smol::block_on(async {
15+
async_io::block_on(async {
1616
let mcm_prop =
1717
df_properties(&mut req, DfProperty::MaxConcurrentMedium).await;
1818
let fds_prop =

pldm-file/examples/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn main() -> Result<()> {
188188

189189
let mut buf = [0u8; 4096];
190190

191-
smol::block_on(async {
191+
async_io::block_on(async {
192192
loop {
193193
let (typ, _ic, buf, chan) = listener.recv(&mut buf).await?;
194194

0 commit comments

Comments
 (0)