Skip to content

Commit 70a357a

Browse files
committed
prefer repeat_n() over repeat().take()
1 parent 4a54b26 commit 70a357a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
878878
.compute_size_in_bytes(layout.size, count)
879879
.ok_or_else(|| err_ub_custom!(fluent::const_eval_size_overflow, name = name))?;
880880

881-
let bytes = std::iter::repeat(byte).take(len.bytes_usize());
881+
let bytes = std::iter::repeat_n(byte, len.bytes_usize());
882882
self.write_bytes_ptr(dst, bytes)
883883
}
884884

0 commit comments

Comments
 (0)