Skip to content

Commit

Permalink
feat(deflate): deprecate in preparation for removal
Browse files Browse the repository at this point in the history
Resolves: #4522.

Pull-Request: #4540.
  • Loading branch information
thomaseizinger committed Sep 27, 2023
1 parent 9cd0f3d commit 91fb6a1
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ libp2p-autonat = { version = "0.11.0", path = "protocols/autonat" }
libp2p-connection-limits = { version = "0.2.1", path = "misc/connection-limits" }
libp2p-core = { version = "0.40.1", path = "core" }
libp2p-dcutr = { version = "0.10.0", path = "protocols/dcutr" }
libp2p-deflate = { version = "0.40.0", path = "transports/deflate" }
libp2p-deflate = { version = "0.40.1", path = "transports/deflate" }
libp2p-dns = { version = "0.40.1", path = "transports/dns" }
libp2p-floodsub = { version = "0.43.0", path = "protocols/floodsub" }
libp2p-gossipsub = { version = "0.45.1", path = "protocols/gossipsub" }
Expand Down
9 changes: 7 additions & 2 deletions libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ pub use libp2p_core as core;
#[cfg(feature = "dcutr")]
#[doc(inline)]
pub use libp2p_dcutr as dcutr;

#[cfg(feature = "deflate")]
#[cfg(not(target_arch = "wasm32"))]
#[doc(inline)]
pub use libp2p_deflate as deflate;
#[deprecated(
note = "Will be removed in the next release, see https://github.com/libp2p/rust-libp2p/issues/4522 for details."
)]
pub mod deflate {
pub use libp2p_deflate::*;
}
#[cfg(feature = "dns")]
#[cfg_attr(docsrs, doc(cfg(feature = "dns")))]
#[cfg(not(target_arch = "wasm32"))]
Expand Down
6 changes: 6 additions & 0 deletions transports/deflate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.40.1 - unreleased

- Deprecate in preparation for removal from the workspace.
See [issue 4522](https://github.com/libp2p/rust-libp2p/issues/4522) for details.
See [PR 4540](https://github.com/libp2p/rust-libp2p/pull/4540).

## 0.40.0

- Raise MSRV to 1.65.
Expand Down
2 changes: 1 addition & 1 deletion transports/deflate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-deflate"
edition = "2021"
rust-version = { workspace = true }
description = "Deflate encryption protocol for libp2p"
version = "0.40.0"
version = "0.40.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
5 changes: 4 additions & 1 deletion transports/deflate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)]
// Copyright 2019 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Expand All @@ -17,13 +18,15 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use futures::{prelude::*, ready};
use libp2p_core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo};
use std::{io, iter, pin::Pin, task::Context, task::Poll};

#[deprecated(
note = "Will be removed in the next release, see https://github.com/libp2p/rust-libp2p/issues/4522 for details."
)]
#[derive(Debug, Copy, Clone)]
pub struct DeflateConfig {
compression: flate2::Compression,
Expand Down
2 changes: 2 additions & 0 deletions transports/deflate/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

// Copyright 2019 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Expand Down

0 comments on commit 91fb6a1

Please sign in to comment.