Skip to content

Commit

Permalink
feat(core): remove upgrade::transfer module
Browse files Browse the repository at this point in the history
As described in #4011, these utility functions don't belong in `libp2p-core`. Users can use `quick-protobuf-codec` if they need to write varint-prefixed protobuf messages. For writing varint-prefixed bytes, the `unsigned-varint` crate offers a various codec implementations.

`libp2p-core` is the base dependency of all other crates. Thus, we should only expose items there that are actually needed by all other crates. For implementation details like how bytes are written, downstream crates (including users) should reach for other crates.

Depends-On: #4787.
Resolves: #4011.

Pull-Request: #4788.
  • Loading branch information
thomaseizinger authored Nov 2, 2023
1 parent d05d836 commit fab9205
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 226 deletions.
3 changes: 3 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
See [PR 4695](https://github.com/libp2p/rust-libp2p/pull/4695).
- Remove deprecated functions from `ListenerId`.
See [PR 4736](https://github.com/libp2p/rust-libp2p/pull/4736).
- Remove `upgrade::transfer` module.
See [issue 4011](https://github.com/libp2p/rust-libp2p/issues/4011) for details.
See [PR 4788](https://github.com/libp2p/rust-libp2p/pull/4788).

## 0.40.1

Expand Down
7 changes: 1 addition & 6 deletions core/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ mod error;
mod pending;
mod ready;
mod select;
mod transfer;

pub(crate) use apply::{
apply, apply_inbound, apply_outbound, InboundUpgradeApply, OutboundUpgradeApply,
Expand All @@ -73,11 +72,7 @@ pub(crate) use error::UpgradeError;
use futures::future::Future;

pub use self::{
denied::DeniedUpgrade,
pending::PendingUpgrade,
ready::ReadyUpgrade,
select::SelectUpgrade,
transfer::{read_length_prefixed, read_varint, write_length_prefixed, write_varint},
denied::DeniedUpgrade, pending::PendingUpgrade, ready::ReadyUpgrade, select::SelectUpgrade,
};
pub use crate::Negotiated;
pub use multistream_select::{NegotiatedComplete, NegotiationError, ProtocolError, Version};
Expand Down
220 changes: 0 additions & 220 deletions core/src/upgrade/transfer.rs

This file was deleted.

0 comments on commit fab9205

Please sign in to comment.