Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Sep 20, 2023
1 parent 066ed1a commit c12357a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ alloc = []
internals = []

[dependencies]
typenum = { version = "1.16", features = ["const-generics"] }
typenum = { version = "1.17", features = ["const-generics"] }
const-default = { version = "1", optional = true, default-features = false }
serde = { version = "1.0", optional = true, default-features = false }
zeroize = { version = "1", optional = true, default-features = false }
Expand Down
21 changes: 6 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,14 +563,9 @@ where
//
// Note that because ArrayConsumer checks for `needs_drop` itself, if `f` panics then nothing
// would have been done about it anyway. Only the other branch needs `ArrayConsumer`
let res = FromIterator::from_iter(left.iter().zip(right.iter()).map(|(l, r)| {
let left_value = ptr::read(l);
let right_value = ptr::read(r);

f(left_value, right_value)
}));

res
FromIterator::from_iter(left.iter().zip(right.iter()).map(|(l, r)| {
f(ptr::read(l), ptr::read(r)) //
}))
}
}
}
Expand Down Expand Up @@ -599,13 +594,9 @@ where
let right = ManuallyDrop::new(self);

// Similar logic to `inverted_zip`'s no-drop branch
let res = FromIterator::from_iter(right.iter().zip(lhs).map(|(r, left_value)| {
let right_value = ptr::read(r);

f(left_value, right_value)
}));

res
FromIterator::from_iter(right.iter().zip(lhs).map(|(r, left_value)| {
f(left_value, ptr::read(r)) //
}))
}
}
}
Expand Down

0 comments on commit c12357a

Please sign in to comment.