Skip to content

Commit

Permalink
Wrap PR 1213 to 80 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 15, 2024
1 parent 75ed447 commit 07f280a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,11 @@ fn push_wtf8_codepoint(n: u32, scratch: &mut Vec<u8>) {

scratch.reserve(4);

// SAFETY: After the `reserve` call, `scratch` has at least 4 bytes of allocated but
// unintialized memory after its last initialized byte, which is where `ptr` points. All
// reachable match arms write `encoded_len` bytes to that region and update the length
// accordingly, and `encoded_len` is always <= 4.
// SAFETY: After the `reserve` call, `scratch` has at least 4 bytes of
// allocated but unintialized memory after its last initialized byte, which
// is where `ptr` points. All reachable match arms write `encoded_len` bytes
// to that region and update the length accordingly, and `encoded_len` is
// always <= 4.
unsafe {
let ptr = scratch.as_mut_ptr().add(scratch.len());

Expand Down

0 comments on commit 07f280a

Please sign in to comment.