From 535e65c02aac3cdefefc48b46084206537cf2959 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 7 Jan 2021 16:01:13 -0500 Subject: [PATCH] refactor: Use itertools' extend with the iter instead of collecting --- object_store/src/path.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/object_store/src/path.rs b/object_store/src/path.rs index de789b6a11..5f9da2957e 100644 --- a/object_store/src/path.rs +++ b/object_store/src/path.rs @@ -70,12 +70,7 @@ impl ObjectStorePath { /// Push a bunch of parts in one go. pub fn push_all<'a>(&mut self, parts: impl AsRef<[&'a str]>) { - // Turn T into a slice of str, validate each one, and collect() it into a - // Vec - let parts = parts.as_ref().iter().map(|&v| v.into()).collect::>(); - - // Push them to the internal path - self.parts.extend(parts); + self.parts.extend(parts.as_ref().iter().map(|&v| v.into())); } /// Return the component parts of the path.