From 525a487806acdf79d3fff37d22d73dcf60c7ff53 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 7 Jun 2025 16:42:47 +0300 Subject: [PATCH] rename argument from `initial_peers` to `initial_peer` --- README.md | 2 +- src/argument.rs | 2 +- src/main.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 003b37b..d464dc5 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ aquatic-crawler --infohash-source /path/to/info-hash-ipv4.json\ --torrent-tracker Define custom tracker(s) to preload the `.torrent` files info ---initial-peers +--initial-peer Define initial peer(s) to preload the `.torrent` files info --enable-dht diff --git a/src/argument.rs b/src/argument.rs index 004bfb5..1243627 100644 --- a/src/argument.rs +++ b/src/argument.rs @@ -30,7 +30,7 @@ pub struct Argument { /// Define initial peer(s) to preload the `.torrent` files info #[arg(long)] - pub initial_peers: Vec, + pub initial_peer: Vec, /// Enable DHT resolver #[arg(long, default_value_t = false)] diff --git a/src/main.rs b/src/main.rs index 81aa64d..c282809 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,8 +31,8 @@ async fn main() -> anyhow::Result<()> { trackers.insert(url::Url::from_str(&tracker)?); } - let mut peers = Vec::with_capacity(argument.initial_peers.len()); - for peer in argument.initial_peers { + let mut peers = Vec::with_capacity(argument.initial_peer.len()); + for peer in argument.initial_peer { peers.push(std::net::SocketAddr::from_str(&peer)?); }