diff options
author | Alex Severin <[email protected]> | 2024-04-21 23:01:54 +0000 |
---|---|---|
committer | Yuchen Wu <[email protected]> | 2024-05-10 15:22:37 -0700 |
commit | 2a449ac305a4573dbb463ac638b63ccfd2653191 (patch) | |
tree | 231108cfb8a675f94f201d01b3c62c5e9c9da701 | |
parent | 42b02241295a3a89bf44014aa991c88fa9e86e1f (diff) | |
download | pingora-2a449ac305a4573dbb463ac638b63ccfd2653191.tar.gz pingora-2a449ac305a4573dbb463ac638b63ccfd2653191.zip |
unzip map items
Includes-commit: db64afd0a38e55f6684931cd2b00307df877510a
Replicated-from: https://github.com/cloudflare/pingora/pull/216
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | pingora-core/src/server/transfer_fd/mod.rs | 12 |
2 files changed, 2 insertions, 12 deletions
@@ -1 +1 @@ -e21e3b7e97830f026794014cf1406dd544cac032
\ No newline at end of file +f753f291f3b4c478428b8233cc472d153650eecf
\ No newline at end of file diff --git a/pingora-core/src/server/transfer_fd/mod.rs b/pingora-core/src/server/transfer_fd/mod.rs index 46807e3..d3e8284 100644 --- a/pingora-core/src/server/transfer_fd/mod.rs +++ b/pingora-core/src/server/transfer_fd/mod.rs @@ -51,17 +51,7 @@ impl Fds { } pub fn serialize(&self) -> (Vec<String>, Vec<RawFd>) { - let serialized: Vec<(String, RawFd)> = self - .map - .iter() - .map(|(key, value)| (key.clone(), *value)) - .collect(); - - ( - serialized.iter().map(|v| v.0.clone()).collect(), - serialized.iter().map(|v| v.1).collect(), - ) - // Surely there is a better way of doing this + self.map.iter().map(|(key, val)| (key.clone(), val)).unzip() } pub fn deserialize(&mut self, binds: Vec<String>, fds: Vec<RawFd>) { |