Skip to content

Commit

Permalink
unzip map items
Browse files Browse the repository at this point in the history
  • Loading branch information
cospectrum committed Apr 26, 2024
1 parent 2501d4a commit db64afd
Showing 1 changed file with 1 addition and 11 deletions.
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 db64afd

Please sign in to comment.