From 62a9e24b97baf8fb7921e995f304bcbef577574e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 6 Jul 2020 00:05:09 +0200 Subject: [PATCH] pkstrings: Utilize HashMap's FromIterator impl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks phaazon! Signed-off-by: Maxime “pep” Buquet --- pkstrings/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkstrings/src/lib.rs b/pkstrings/src/lib.rs index 5a6fb1a..0ec404f 100644 --- a/pkstrings/src/lib.rs +++ b/pkstrings/src/lib.rs @@ -108,11 +108,7 @@ lazy_static! { ('@', 0x50), ]; - let mut map = HashMap::new(); - for (k, v) in tmp.iter() { - map.insert(*k, *v); - } - map + tmp.iter().copied().collect() }; static ref HEXTOSTR: Vec> = { let tmp = [