mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
unzip map items
This commit is contained in:
parent
2501d4adb0
commit
db64afd0a3
1 changed files with 1 additions and 11 deletions
|
@ -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>) {
|
||||
|
|
Loading…
Reference in a new issue