From 7d379e94e19896ad68ea8fbe05d251fd6176de81 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 16 Mar 2023 09:28:17 -0700 Subject: [PATCH] Have cap-std re-export ipnet, which is part of its public API. (#302) --- cap-async-std/Cargo.toml | 1 - cap-async-std/src/lib.rs | 3 ++- cap-async-std/src/net/pool.rs | 2 +- cap-primitives/src/lib.rs | 2 ++ cap-std/Cargo.toml | 1 - cap-std/src/lib.rs | 3 ++- cap-std/src/net/pool.rs | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cap-async-std/Cargo.toml b/cap-async-std/Cargo.toml index 1fbd14a9..ec139695 100644 --- a/cap-async-std/Cargo.toml +++ b/cap-async-std/Cargo.toml @@ -19,7 +19,6 @@ arf-strings = { version = "0.7.0", optional = true } async-std = { version = "1.10.0", features = ["attributes", "unstable"] } cap-primitives = { path = "../cap-primitives", version = "^0.25.0" } io-lifetimes = { version = "1.0.0", default-features = false, features = ["async-std"] } -ipnet = "2.3.0" io-extras = { version = "0.17.0", features = ["use_async_std"] } camino = { version = "1.0.5", optional = true } diff --git a/cap-async-std/src/lib.rs b/cap-async-std/src/lib.rs index ad53195b..9912a2bb 100644 --- a/cap-async-std/src/lib.rs +++ b/cap-async-std/src/lib.rs @@ -50,5 +50,6 @@ pub use cap_primitives::{ambient_authority, AmbientAuthority}; // Re-export `async_std` to make it easy for users to depend on the same // version we do, because we use its types in our public API. pub use async_std; -// And this is also part of our public API +// And these are also part of our public API pub use io_lifetimes; +pub use cap_primitives::ipnet; diff --git a/cap-async-std/src/net/pool.rs b/cap-async-std/src/net/pool.rs index e2aaaf8f..24106ea3 100644 --- a/cap-async-std/src/net/pool.rs +++ b/cap-async-std/src/net/pool.rs @@ -1,7 +1,7 @@ use crate::net::{TcpListener, TcpStream, ToSocketAddrs, UdpSocket}; use async_std::{io, net}; use cap_primitives::net::NO_SOCKET_ADDRS; -use cap_primitives::AmbientAuthority; +use cap_primitives::{ipnet, AmbientAuthority}; /// A pool of network addresses. /// diff --git a/cap-primitives/src/lib.rs b/cap-primitives/src/lib.rs index 19112cfe..e9943917 100644 --- a/cap-primitives/src/lib.rs +++ b/cap-primitives/src/lib.rs @@ -28,3 +28,5 @@ pub mod time; #[doc(hidden)] pub use ambient_authority::ambient_authority_known_at_compile_time; pub use ambient_authority::{ambient_authority, AmbientAuthority}; +// This is part of our public API. +pub use ipnet; diff --git a/cap-std/Cargo.toml b/cap-std/Cargo.toml index 538d57c7..48dc3b3d 100644 --- a/cap-std/Cargo.toml +++ b/cap-std/Cargo.toml @@ -19,7 +19,6 @@ rustdoc-args = ["--cfg=doc_cfg"] [dependencies] arf-strings = { version = "0.7.0", optional = true } cap-primitives = { path = "../cap-primitives", version = "^1.0.7" } -ipnet = "2.3.0" io-extras = "0.17.0" io-lifetimes = { version = "1.0.0", default-features = false } camino = { version = "1.0.5", optional = true } diff --git a/cap-std/src/lib.rs b/cap-std/src/lib.rs index 9723bc1d..5ddf9f49 100644 --- a/cap-std/src/lib.rs +++ b/cap-std/src/lib.rs @@ -48,5 +48,6 @@ pub mod time; #[doc(hidden)] pub use cap_primitives::ambient_authority_known_at_compile_time; pub use cap_primitives::{ambient_authority, AmbientAuthority}; -// And this is also part of our public API +// And these are also part of our public API +pub use cap_primitives::ipnet; pub use io_lifetimes; diff --git a/cap-std/src/net/pool.rs b/cap-std/src/net/pool.rs index 084304de..ac2ae957 100644 --- a/cap-std/src/net/pool.rs +++ b/cap-std/src/net/pool.rs @@ -1,6 +1,6 @@ use crate::net::{SocketAddr, TcpListener, TcpStream, ToSocketAddrs, UdpSocket}; use cap_primitives::net::NO_SOCKET_ADDRS; -use cap_primitives::AmbientAuthority; +use cap_primitives::{ipnet, AmbientAuthority}; use std::time::Duration; use std::{io, net};