From 13833c2872b02ede5a2b339e66226af1b1dbb271 Mon Sep 17 00:00:00 2001 From: Jonas Pommerening Date: Fri, 18 Jun 2021 12:15:31 +0200 Subject: Use .or_insert_with to avoid creating unnecessary Vecs --- src/container.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/container.rs b/src/container.rs index e73abf5..cc8d288 100644 --- a/src/container.rs +++ b/src/container.rs @@ -513,7 +513,7 @@ impl ContainerListOptionsBuilder { ContainerFilter::Label(n, v) => ("label", format!("{}={}", n, v)), }; - param.entry(key).or_insert(Vec::new()).push(value); + param.entry(key).or_insert_with(Vec::new).push(value); } // structure is a a json encoded object mapping string keys to a list // of string values -- cgit v1.2.3