Skip to content

Commit

Permalink
unzip map items
Browse files Browse the repository at this point in the history
Includes-commit: db64afd
Replicated-from: #216
  • Loading branch information
cospectrum authored and johnhurt committed Apr 30, 2024
1 parent 074b362 commit e9429e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e21e3b7e97830f026794014cf1406dd544cac032
f753f291f3b4c478428b8233cc472d153650eecf
12 changes: 1 addition & 11 deletions pingora-core/src/server/transfer_fd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>) {
Expand Down

0 comments on commit e9429e5

Please sign in to comment.