aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src/tcp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net/src/tcp.rs')
-rw-r--r--embassy-net/src/tcp.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs
index bcddbc95b..1bd582b65 100644
--- a/embassy-net/src/tcp.rs
+++ b/embassy-net/src/tcp.rs
@@ -675,10 +675,9 @@ mod embedded_io_impls {
675pub mod client { 675pub mod client {
676 use core::cell::{Cell, UnsafeCell}; 676 use core::cell::{Cell, UnsafeCell};
677 use core::mem::MaybeUninit; 677 use core::mem::MaybeUninit;
678 use core::net::IpAddr;
678 use core::ptr::NonNull; 679 use core::ptr::NonNull;
679 680
680 use embedded_nal_async::IpAddr;
681
682 use super::*; 681 use super::*;
683 682
684 /// TCP client connection pool compatible with `embedded-nal-async` traits. 683 /// TCP client connection pool compatible with `embedded-nal-async` traits.
@@ -715,17 +714,14 @@ pub mod client {
715 type Error = Error; 714 type Error = Error;
716 type Connection<'m> = TcpConnection<'m, N, TX_SZ, RX_SZ> where Self: 'm; 715 type Connection<'m> = TcpConnection<'m, N, TX_SZ, RX_SZ> where Self: 'm;
717 716
718 async fn connect<'a>( 717 async fn connect<'a>(&'a self, remote: core::net::SocketAddr) -> Result<Self::Connection<'a>, Self::Error> {
719 &'a self,
720 remote: embedded_nal_async::SocketAddr,
721 ) -> Result<Self::Connection<'a>, Self::Error> {
722 let addr: crate::IpAddress = match remote.ip() { 718 let addr: crate::IpAddress = match remote.ip() {
723 #[cfg(feature = "proto-ipv4")] 719 #[cfg(feature = "proto-ipv4")]
724 IpAddr::V4(addr) => crate::IpAddress::Ipv4(crate::Ipv4Address::from_bytes(&addr.octets())), 720 IpAddr::V4(addr) => crate::IpAddress::Ipv4(addr),
725 #[cfg(not(feature = "proto-ipv4"))] 721 #[cfg(not(feature = "proto-ipv4"))]
726 IpAddr::V4(_) => panic!("ipv4 support not enabled"), 722 IpAddr::V4(_) => panic!("ipv4 support not enabled"),
727 #[cfg(feature = "proto-ipv6")] 723 #[cfg(feature = "proto-ipv6")]
728 IpAddr::V6(addr) => crate::IpAddress::Ipv6(crate::Ipv6Address::from_bytes(&addr.octets())), 724 IpAddr::V6(addr) => crate::IpAddress::Ipv6(addr),
729 #[cfg(not(feature = "proto-ipv6"))] 725 #[cfg(not(feature = "proto-ipv6"))]
730 IpAddr::V6(_) => panic!("ipv6 support not enabled"), 726 IpAddr::V6(_) => panic!("ipv6 support not enabled"),
731 }; 727 };