Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embedded-nal-async dependency to 0.8 #91

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "reqwless"
version = "0.12.1"
edition = "2021"
resolver = "2"
rust-version = "1.77"
description = "HTTP client for embedded devices"
documentation = "https://docs.rs/reqwless"
readme = "README.md"
Expand All @@ -16,7 +17,7 @@ exclude = [".github"]
buffered-io = { version = "0.5.4" }
embedded-io = { version = "0.6" }
embedded-io-async = { version = "0.6" }
embedded-nal-async = "0.7.0"
embedded-nal-async = "0.8.0"
httparse = { version = "1.8.0", default-features = false }
heapless = "0.8"
hex = { version = "0.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ This enables `alloc` on `embedded-tls` which in turn enables RSA signature algor

# Minimum supported Rust version (MSRV)

`reqwless` can compile on stable Rust 1.75 and up.
`reqwless` can compile on stable Rust 1.77 and up.
5 changes: 0 additions & 5 deletions rust-toolchain.toml

This file was deleted.

3 changes: 2 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ use crate::request::*;
use crate::response::*;
use crate::Error;
use buffered_io::asynch::BufferedWrite;
use core::net::SocketAddr;
use embedded_io::Error as _;
use embedded_io::ErrorType;
use embedded_io_async::{Read, Write};
use embedded_nal_async::{Dns, SocketAddr, TcpConnect};
use embedded_nal_async::{Dns, TcpConnect};
use nourl::{Url, UrlScheme};

/// An async HTTP client that can establish a TCP connection and perform
Expand Down
13 changes: 5 additions & 8 deletions tests/connection.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use embedded_io_adapters::tokio_1::FromTokio;
use embedded_io_async::{ErrorType, Read, Write};
use embedded_nal_async::{AddrType, IpAddr, Ipv4Addr};
use embedded_nal_async::AddrType;
use reqwless::TryBufRead;
use std::net::{SocketAddr, ToSocketAddrs};
use std::net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs};
use tokio::net::TcpStream;

#[derive(Debug)]
Expand Down Expand Up @@ -77,13 +77,10 @@ impl embedded_nal_async::TcpConnect for TokioTcp {
type Error = std::io::Error;
type Connection<'m> = TokioStream;

async fn connect<'m>(
&'m self,
remote: embedded_nal_async::SocketAddr,
) -> Result<Self::Connection<'m>, Self::Error> {
async fn connect<'m>(&'m self, remote: SocketAddr) -> Result<Self::Connection<'m>, Self::Error> {
let ip = match remote {
embedded_nal_async::SocketAddr::V4(a) => a.ip().octets().into(),
embedded_nal_async::SocketAddr::V6(a) => a.ip().octets().into(),
SocketAddr::V4(a) => a.ip().octets().into(),
SocketAddr::V6(a) => a.ip().octets().into(),
};
let remote = SocketAddr::new(ip, remote.port());
let stream = TcpStream::connect(remote).await?;
Expand Down
Loading