finish zip todo

Includes-commit: 68a9196642
Replicated-from: https://github.com/cloudflare/pingora/pull/214
This commit is contained in:
Alex Severin 2024-04-21 21:55:20 +00:00 committed by Yuchen Wu
parent 2a449ac305
commit 4347ef4471
2 changed files with 4 additions and 5 deletions

2
.bleep
View file

@ -1 +1 @@
f753f291f3b4c478428b8233cc472d153650eecf b5cb1b6f679bf1dcd136617b0212eb4f7c4bce84

View file

@ -55,10 +55,9 @@ impl Fds {
} }
pub fn deserialize(&mut self, binds: Vec<String>, fds: Vec<RawFd>) { pub fn deserialize(&mut self, binds: Vec<String>, fds: Vec<RawFd>) {
assert!(binds.len() == fds.len()); assert_eq!(binds.len(), fds.len());
// TODO: use zip() for (bind, fd) in binds.into_iter().zip(fds) {
for i in 0..binds.len() { self.map.insert(bind, fd);
self.map.insert(binds[i].clone(), fds[i]);
} }
} }