From dae83a18350274352eab86c6e101a8cc0b51ffb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 20 Jul 2020 22:35:08 +0200 Subject: [PATCH] aquatic http protocol: ScrapeRequest::to_bytes(): use urlencode_20_bytes --- aquatic_http_protocol/src/request.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/aquatic_http_protocol/src/request.rs b/aquatic_http_protocol/src/request.rs index a3a9eb8..be49466 100644 --- a/aquatic_http_protocol/src/request.rs +++ b/aquatic_http_protocol/src/request.rs @@ -93,11 +93,7 @@ impl ScrapeRequest { } bytes.extend_from_slice(b"info_hash="); - - for b in info_hash.0.iter() { - bytes.push(b'%'); - bytes.extend_from_slice(format!("{:02x}", b).as_bytes()); - } + urlencode_20_bytes(info_hash.0, &mut bytes); first = false; }