-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed unwind safe within zip_elements
#2
base: master
Are you sure you want to change the base?
Conversation
map_elements
zip_elements
The PR title says " |
src/lib.rs
Outdated
@@ -172,13 +172,14 @@ impl<A, M: ArrayLength<A>, N: ArrayLength<GenericArray<A, M>>> Matrix<A, M, N> { | |||
#[inline] fn map_elements<B, F: FnMut(A) -> B>(self, mut f: F) -> Matrix<B, M, N> | |||
where M: ArrayLength<B>, N: ArrayLength<GenericArray<B, M>> { | |||
let Matrix(a) = self; | |||
let _wrapper = mem::ManuallyDrop::new(a); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the leading underscore? We use it below.
src/lib.rs
Outdated
Matrix(c) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrub this, please
Yeah, that's my fault, I'll fix this soon. |
By this I mean, they are both broken. 😂 |
The code reformatter might have changed the codes format .. hope you don't mind 😭 |
I'd prefer you not reformat the file... |
This should make it sound |
This should fixes #1 , which wraps a
ManuallyDrop
around the original matrix to prevent unintentional dropping of its elements.