Skip to content

Commit

Permalink
Adjusted safety comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostie314159 committed Dec 17, 2023
1 parent a197f78 commit 2192786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ impl<'a, Ctx: Copy, T: TryFromCtx<'a, Ctx, Error = error::Error>, const N: usize
type Error = error::Error;
fn try_from_ctx(src: &'a [u8], ctx: Ctx) -> Result<(Self, usize), Self::Error> {
let mut offset = 0;
// SAFETY: We will return an error if filling any of these fails.
// SAFETY: This will only be read after everything was overwritten.
let mut buf: [T; N] = unsafe { zeroed() };

for element in buf.iter_mut() {
Expand Down

0 comments on commit 2192786

Please sign in to comment.