Skip to content

Commit 513a6a7

Browse files
committed
fix
1 parent 8ed9fef commit 513a6a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/byteview.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ impl ByteView {
252252
///
253253
/// Returns an error if an I/O error occurred.
254254
pub fn from_reader<R: std::io::Read>(reader: &mut R, len: usize) -> std::io::Result<Self> {
255-
// NOTE: We can use _unchecked to skip zeroing of the heap allocated slice
255+
// NOTE: We can use _unzeroed to skip zeroing of the heap allocated slice
256256
// because we receive the `len` parameter
257257
// If the reader does not give us exactly `len` bytes, `read_exact` fails anyway
258-
let mut s = Self::with_size_unchecked(len);
258+
let mut s = Self::with_size_unzeroed(len);
259259
{
260260
let mut builder = Mutator(&mut s);
261261
reader.read_exact(&mut builder)?;
@@ -267,7 +267,7 @@ impl ByteView {
267267
#[must_use]
268268
pub fn fused(left: &[u8], right: &[u8]) -> Self {
269269
let len: usize = left.len() + right.len();
270-
let mut builder = Self::with_size_unchecked(len);
270+
let mut builder = Self::with_size_unzeroed(len);
271271

272272
// NOTE:
273273
//
@@ -429,7 +429,7 @@ impl ByteView {
429429
pub fn new(slice: &[u8]) -> Self {
430430
let slice_len = slice.len();
431431

432-
let mut view = Self::with_size_unchecked(slice_len);
432+
let mut view = Self::with_size_unzeroed(slice_len);
433433

434434
if view.is_inline() {
435435
// SAFETY: We check for inlinability

0 commit comments

Comments
 (0)