Skip to content

Commit 8b39b4d

Browse files
authored
Merge pull request #102 from newAM/ip-in-core
Use stabilized ip_in_core feature
2 parents 2ad0b03 + 8ee9ac3 commit 8b39b4d

File tree

17 files changed

+18
-59
lines changed

17 files changed

+18
-59
lines changed

Diff for: .github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
include:
2121
# Test MSRV
22-
- rust: 1.60.0
22+
- rust: 1.77.0
2323
TARGET: x86_64-unknown-linux-gnu
2424

2525
# Test nightly but don't fail
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
strategy:
4444
matrix:
45-
rust: [nightly-2023-11-01]
45+
rust: [stable]
4646
TARGET:
4747
[x86_64-unknown-linux-gnu, thumbv6m-none-eabi, thumbv7m-none-eabi]
4848

Diff for: .github/workflows/rustfmt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v3
2424
- uses: dtolnay/rust-toolchain@master
2525
with:
26-
toolchain: nightly-2023-11-01
26+
toolchain: stable
2727
components: rustfmt
2828
- run: cargo fmt --all -- --check
2929
working-directory: embedded-nal-async

Diff for: CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10-
No unreleased changes yet
10+
- Bump MSRV to 1.77.0 for `ip_in_core`.
11+
- Removed the `no-std-net` and `ip_in_core` features, `ip_in_core` is now the default.
1112

1213
## [0.8.0] - 2023-11-10
1314

Diff for: Cargo.toml

-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,5 @@ readme = "README.md"
1717
keywords = ["network"]
1818
categories = ["embedded", "hardware-support", "no-std", "network-programming"]
1919

20-
[features]
21-
default = ["no-std-net"]
22-
ip_in_core = []
23-
2420
[dependencies]
2521
nb = "1"
26-
no-std-net = { version = "0.6", optional = true }

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ These issues / PRs will be labeled as `proposal`s in the issue tracker.
3535

3636
## Minimum Supported Rust Version (MSRV)
3737

38-
This crate is guaranteed to compile on stable Rust 1.60.0 and up. It _might_
38+
This crate is guaranteed to compile on stable Rust 1.77.0 and up. It _might_
3939
compile with older versions but that may change in any new patch release.
4040

4141
## License

Diff for: embedded-nal-async/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10-
No unreleased changes yet.
10+
- Removed the `ip_in_core` feature, this is now the default.
1111

1212
## [0.7.1] - 2023-11-28
1313

Diff for: embedded-nal-async/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ readme = "README.md"
1111
keywords = ["network"]
1212
categories = ["embedded", "hardware-support", "no-std", "network-programming", "asynchronous"]
1313

14-
[features]
15-
ip_in_core = []
16-
1714
[dependencies]
18-
no-std-net = "0.6"
1915
embedded-nal = { version = "0.8.0", path = "../" }
2016
embedded-io-async = { version = "0.6.0" }

Diff for: embedded-nal-async/build.rs

-18
This file was deleted.

Diff for: embedded-nal-async/src/dns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::IpAddr;
1+
use core::net::IpAddr;
22
use embedded_nal::AddrType;
33

44
/// This trait is an extension trait for [`TcpStack`] and [`UdpStack`] for dns

Diff for: embedded-nal-async/src/lib.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
//! # embedded-nal-async - An async Network Abstraction Layer for Embedded Systems
22
33
#![no_std]
4-
#![cfg_attr(nightly, allow(stable_features, unknown_lints))]
5-
#![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))]
64
#![allow(async_fn_in_trait)]
75
#![deny(missing_docs)]
86
#![deny(unsafe_code)]
9-
#![cfg_attr(feature = "ip_in_core", feature(ip_in_core))]
107

118
mod dns;
129
mod stack;
1310

14-
#[cfg(feature = "ip_in_core")]
15-
pub use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
16-
#[cfg(not(feature = "ip_in_core"))]
17-
pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
18-
1911
pub use dns::Dns;
2012
pub use embedded_nal::AddrType;
2113
pub use stack::TcpConnect;

Diff for: embedded-nal-async/src/stack/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::SocketAddr;
1+
use core::net::SocketAddr;
22

33
/// This trait is implemented by TCP/IP stacks. The trait allows the underlying driver to
44
/// construct multiple connections that implement the I/O traits from embedded-io-async.

Diff for: embedded-nal-async/src/stack/udp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! Implementing `UniquelyBound` and `MultiplyBound` with the same type is expected to be a
1515
//! common choice.
1616
17-
use crate::SocketAddr;
17+
use core::net::SocketAddr;
1818

1919
/// This trait is implemented by UDP sockets.
2020
///
@@ -140,7 +140,7 @@ pub trait UdpStack {
140140
&self,
141141
remote: SocketAddr,
142142
) -> Result<(SocketAddr, Self::Connected), Self::Error> {
143-
use crate::{Ipv4Addr, Ipv6Addr, SocketAddr::*, SocketAddrV4, SocketAddrV6};
143+
use core::net::{Ipv4Addr, Ipv6Addr, SocketAddr::*, SocketAddrV4, SocketAddrV6};
144144

145145
let local = match remote {
146146
V4(_) => V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, 0)),

Diff for: src/dns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::IpAddr;
1+
use core::net::IpAddr;
22

33
/// This is the host address type to be returned by `gethostbyname`.
44
///

Diff for: src/lib.rs

-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
#![no_std]
33
#![deny(missing_docs)]
44
#![deny(unsafe_code)]
5-
#![cfg_attr(feature = "ip_in_core", feature(ip_in_core))]
65

76
mod dns;
87
mod stack;
98

109
pub use nb;
1110

12-
#[cfg(not(any(feature = "ip_in_core", feature = "no-std-net")))]
13-
compile_error!("You must select the ip_in_core feature or the no-std-net feature");
14-
15-
#[cfg(feature = "ip_in_core")]
16-
pub use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
17-
#[cfg(not(feature = "ip_in_core"))]
18-
pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
19-
2011
pub use dns::{AddrType, Dns};
2112
pub use stack::{
2213
SharableStack, SharedStack, TcpClientStack, TcpError, TcpErrorKind, TcpFullStack,

Diff for: src/stack/share.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use crate::{nb, SocketAddr, TcpClientStack, TcpFullStack, UdpClientStack, UdpFullStack};
1+
use crate::{nb, TcpClientStack, TcpFullStack, UdpClientStack, UdpFullStack};
22
use core::cell::RefCell;
3+
use core::net::SocketAddr;
34

45
/// Sharable wrapper for a network stack implementation.
56
///
@@ -12,7 +13,8 @@ use core::cell::RefCell;
1213
///
1314
/// ```
1415
/// use embedded_nal::SharableStack;
15-
/// # use embedded_nal::{UdpClientStack, SocketAddr, SocketAddrV4, Ipv4Addr, nb};
16+
/// use core::net::{SocketAddr, SocketAddrV4, Ipv4Addr};
17+
/// # use embedded_nal::{UdpClientStack, nb};
1618
/// # struct SomeNalDriver {}
1719
/// # impl SomeNalDriver {
1820
/// # fn new() -> Self { Self {} }

Diff for: src/stack/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::SocketAddr;
1+
use core::net::SocketAddr;
22

33
/// Represents specific errors encountered during TCP operations.
44
#[non_exhaustive]

Diff for: src/stack/udp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::SocketAddr;
1+
use core::net::SocketAddr;
22

33
/// This trait is implemented by UDP/IP stacks. You could, for example, have
44
/// an implementation which knows how to send AT commands to an ESP8266 WiFi

0 commit comments

Comments
 (0)