From 18d06cc867fb3c7c10b7494b96d213aa62fa9927 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 1 Mar 2021 10:48:45 +0100 Subject: Refactor: Environment variable aggregation This patch refactors the collecting of the environment variables in the `RunnableJob::build_from_job()` implementation as well as in the `RunnableJob::environemtn()` implementation. This results in fewer allocations, especially but not only because the `RunnableJob::environment()` function returns an iterator now and all clone() calls were removed. Signed-off-by: Matthias Beyer --- src/endpoint/configured.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/endpoint/configured.rs') diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs index d7673c0..311e0a6 100644 --- a/src/endpoint/configured.rs +++ b/src/endpoint/configured.rs @@ -304,7 +304,6 @@ impl<'a> PreparedContainer<'a> { ) -> Result { let envs = job .environment() - .into_iter() .map(|(k, v)| format!("{}={}", k.as_ref(), v)) .collect::>(); trace!("Job resources: Environment variables = {:?}", envs); -- cgit v1.2.3