Skip to content

Commit 0e4df74

Browse files
committed
prefer to use repeat_n over repeat and take
1 parent cc00f45 commit 0e4df74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ fn data_id_for_static(
318318
let mut data = DataDescription::new();
319319
data.set_align(align);
320320
let data_gv = module.declare_data_in_data(data_id, &mut data);
321-
data.define(std::iter::repeat(0).take(pointer_ty(tcx).bytes() as usize).collect());
321+
data.define(std::iter::repeat_n(0, pointer_ty(tcx).bytes() as usize).collect());
322322
data.write_data_addr(0, data_gv, 0);
323323
match module.define_data(ref_data_id, &data) {
324324
// Every time the static is referenced there will be another definition of this global,

0 commit comments

Comments
 (0)