Skip to content

Commit

Permalink
Remove smol
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 19, 2023
1 parent d96b37b commit 6f8e6a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ rumqttc = { version = "0.19", optional = true }

[dev-dependencies]
anyhow = "1"
smol = "1"
simple_logger="2.2"

[[example]]
Expand Down
5 changes: 3 additions & 2 deletions examples/http_client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::error::Error;

use async_io::block_on;
use embedded_io_async::Read;
use embedded_nal_async::TcpConnect;

Expand All @@ -10,7 +11,7 @@ use edge_net::asynch::stdnal::StdTcpConnect;
fn main() {
simple_logger::SimpleLogger::new().env().init().unwrap();

smol::block_on(read()).unwrap();
block_on(read()).unwrap();
}

async fn read() -> anyhow::Result<()> {
Expand All @@ -22,7 +23,7 @@ async fn read() -> anyhow::Result<()> {
let mut connection = ClientConnection::<1024, _>::new(
&mut buf,
&connector,
"34.227.213.82:80".parse().unwrap(), /*httpbin.org*/
"44.194.147.17:80".parse().unwrap(), /*httpbin.org*/
);

for uri in ["/ip", "/headers"] {
Expand Down
7 changes: 4 additions & 3 deletions examples/http_server.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#![feature(cfg_version)]
#![allow(stable_features)]
#![feature(async_fn_in_trait)]

use core::future::pending;

use async_io::block_on;
use log::LevelFilter;

use edge_net::asynch::{
Expand All @@ -24,15 +25,15 @@ fn main() {
.init()
.unwrap();

smol::block_on(accept());
block_on(accept());
}

pub async fn accept() {
let binder = StdTcpListen::new();

run::<StdRawMutex, _>(
binder
.listen("0.0.0.0:8080".parse().unwrap())
.listen("0.0.0.0:8181".parse().unwrap())
.await
.unwrap(),
)
Expand Down
3 changes: 2 additions & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use async_io::block_on;
use embedded_io_async::{Read, Write};
use embedded_nal_async::TcpConnect;

use edge_net::asynch::stdnal::StdTcpConnect;

fn main() {
smol::block_on(read()).unwrap();
block_on(read()).unwrap();
}

async fn read() -> anyhow::Result<()> {
Expand Down

0 comments on commit 6f8e6a4

Please sign in to comment.