From bd07215a094240bba0de07a4c27b7064b0081f83 Mon Sep 17 00:00:00 2001 From: lido333 Date: Fri, 14 Mar 2025 20:27:47 +0800 Subject: [PATCH 1/3] fix --- misc/keygen/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/keygen/src/main.rs b/misc/keygen/src/main.rs index 4c4d3bfbf66..9f258be56d4 100644 --- a/misc/keygen/src/main.rs +++ b/misc/keygen/src/main.rs @@ -16,13 +16,13 @@ use libp2p_identity::PeerId; use zeroize::Zeroizing; #[derive(Debug, Parser)] -#[clap(name = "libp2p key material generator")] +#[command(name = "libp2p key material generator")] struct Args { /// JSON formatted output - #[clap(long, global = true)] + #[arg(long, global = true)] json: bool, - #[clap(subcommand)] + #[command(subcommand)] cmd: Command, } @@ -31,13 +31,13 @@ enum Command { /// Read from config file From { /// Provide a IPFS config file - #[clap(value_parser)] + #[arg(value_parser)] config: PathBuf, }, /// Generate random Rand { /// The keypair prefix - #[clap(long)] + #[arg(long)] prefix: Option, }, } From 725030e4c08721bc324b42751678c41ed226a178 Mon Sep 17 00:00:00 2001 From: lido333 Date: Fri, 14 Mar 2025 20:28:28 +0800 Subject: [PATCH 2/3] fix --- misc/server/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/server/src/main.rs b/misc/server/src/main.rs index a633a80207e..18d4564ae39 100644 --- a/misc/server/src/main.rs +++ b/misc/server/src/main.rs @@ -21,22 +21,22 @@ mod config; mod http_service; #[derive(Debug, Parser)] -#[clap(name = "libp2p server", about = "A rust-libp2p server binary.")] +#[command(name = "libp2p server", about = "A rust-libp2p server binary.")] struct Opts { /// Path to IPFS config file. - #[clap(long)] + #[arg(long)] config: PathBuf, /// Metric endpoint path. - #[clap(long, default_value = "/metrics")] + #[arg(long, default_value = "/metrics")] metrics_path: String, /// Whether to run the libp2p Kademlia protocol and join the IPFS DHT. - #[clap(long)] + #[arg(long)] enable_kademlia: bool, /// Whether to run the libp2p Autonat protocol. - #[clap(long)] + #[arg(long)] enable_autonat: bool, } From f7b8245ab10b036a0a9945d1968b4ad5f41c3944 Mon Sep 17 00:00:00 2001 From: lido333 Date: Fri, 14 Mar 2025 23:21:13 +0800 Subject: [PATCH 3/3] fix linting --- Cargo.lock | 2 +- Cargo.toml | 2 +- misc/server/CHANGELOG.md | 7 +++++++ misc/server/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c82fdec4223..9ea7d2ed31c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3312,7 +3312,7 @@ dependencies = [ [[package]] name = "libp2p-server" -version = "0.12.6" +version = "0.12.7" dependencies = [ "axum", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index 289106cc5f0..d04f047f5fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,7 +100,7 @@ libp2p-quic = { version = "0.12.1", path = "transports/quic" } libp2p-relay = { version = "0.20.0", path = "protocols/relay" } libp2p-rendezvous = { version = "0.16.0", path = "protocols/rendezvous" } libp2p-request-response = { version = "0.28.1", path = "protocols/request-response" } -libp2p-server = { version = "0.12.6", path = "misc/server" } +libp2p-server = { version = "0.12.7", path = "misc/server" } libp2p-stream = { version = "0.3.0-alpha", path = "protocols/stream" } libp2p-swarm = { version = "0.47.0", path = "swarm" } libp2p-swarm-derive = { version = "=0.35.1", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required. diff --git a/misc/server/CHANGELOG.md b/misc/server/CHANGELOG.md index 53341baa9ab..4f4e31bb7d8 100644 --- a/misc/server/CHANGELOG.md +++ b/misc/server/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.12.7 + +### Changed + +- Deprecated #[clap] attributes with #[arg] and #[command]. + See [PR 5932](https://github.com/libp2p/rust-libp2p/pull/5932) + ## 0.12.6 ### Changed diff --git a/misc/server/Cargo.toml b/misc/server/Cargo.toml index 0767dd82dc1..e8266f99974 100644 --- a/misc/server/Cargo.toml +++ b/misc/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-server" -version = "0.12.6" +version = "0.12.7" authors = ["Max Inden "] edition.workspace = true repository = "https://github.com/libp2p/rust-libp2p"