Skip to content

Commit

Permalink
Remove unsafe code (fix #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbeam committed Jan 27, 2021
1 parent e626775 commit 6299af0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ impl<'a> Record<'a> {
return Err(Error::RecordTooShort(len));
}

data.reserve(len - 5);
unsafe { data.set_len(len) };
data.resize(len, 0);
input.read_exact(&mut data[5..len])?;

let data_offset = misc::read_dec_5(&data[12..17])?;
Expand Down

0 comments on commit 6299af0

Please sign in to comment.