From cb6aaf38ca45003393426b4238915fa6b46d69c6 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 27 Jul 2023 15:58:53 +0000 Subject: [PATCH] Remove `async_std_connection` module and move `with_buffers` one level up (#976) --- full-node/src/network_service/tasks.rs | 3 +-- lib/src/libp2p.rs | 2 +- lib/src/libp2p/async_std_connection.rs | 21 ------------------- .../with_buffers.rs | 1 + light-base/src/platform.rs | 2 +- 5 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 lib/src/libp2p/async_std_connection.rs rename lib/src/libp2p/{async_std_connection => }/with_buffers.rs (99%) diff --git a/full-node/src/network_service/tasks.rs b/full-node/src/network_service/tasks.rs index 687524112f..013df87037 100644 --- a/full-node/src/network_service/tasks.rs +++ b/full-node/src/network_service/tasks.rs @@ -26,9 +26,8 @@ use smol::{ }; use smoldot::{ libp2p::{ - async_std_connection::with_buffers, multiaddr::{Multiaddr, ProtocolRef}, - websocket, + websocket, with_buffers, }, network::service::{self, CoordinatorToConnection}, }; diff --git a/lib/src/libp2p.rs b/lib/src/libp2p.rs index 1192a516ae..f136acd4ee 100644 --- a/lib/src/libp2p.rs +++ b/lib/src/libp2p.rs @@ -91,7 +91,6 @@ //! See also the documentation of [`peers`] for more information. //! -pub mod async_std_connection; pub mod collection; pub mod connection; pub mod multiaddr; @@ -100,6 +99,7 @@ pub mod peer_id; pub mod peers; pub mod read_write; pub mod websocket; +pub mod with_buffers; pub use multiaddr::Multiaddr; pub use peer_id::PeerId; diff --git a/lib/src/libp2p/async_std_connection.rs b/lib/src/libp2p/async_std_connection.rs deleted file mode 100644 index d903d6ec23..0000000000 --- a/lib/src/libp2p/async_std_connection.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Smoldot -// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#![cfg(feature = "std")] -#![cfg_attr(docsrs, doc(cfg(feature = "std")))] - -pub mod with_buffers; diff --git a/lib/src/libp2p/async_std_connection/with_buffers.rs b/lib/src/libp2p/with_buffers.rs similarity index 99% rename from lib/src/libp2p/async_std_connection/with_buffers.rs rename to lib/src/libp2p/with_buffers.rs index 2fb75217cd..91aef4fdef 100644 --- a/lib/src/libp2p/async_std_connection/with_buffers.rs +++ b/lib/src/libp2p/with_buffers.rs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#![cfg(feature = "std")] #![cfg_attr(docsrs, doc(cfg(feature = "std")))] //! Augments an implementation of `AsyncRead` and `AsyncWrite` with a read buffer and a write diff --git a/light-base/src/platform.rs b/light-base/src/platform.rs index 41608854c3..009d250b1e 100644 --- a/light-base/src/platform.rs +++ b/light-base/src/platform.rs @@ -23,7 +23,7 @@ pub use smoldot::libp2p::read_write; #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] -pub use smoldot::libp2p::async_std_connection::with_buffers; +pub use smoldot::libp2p::with_buffers; pub mod address_parse; pub mod default;