Skip to content

Commit a9e95b0

Browse files
committed
chore: fix clippy
1 parent 54a6cfc commit a9e95b0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

datafusion/datasource-json/benches/json_boundary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn build_fixed_json_lines(line_len: usize, lines: usize) -> Bytes {
160160
let padding_len = line_len - prefix.len() - suffix.len();
161161
let mut line = Vec::with_capacity(line_len);
162162
line.extend_from_slice(prefix.as_bytes());
163-
line.extend(std::iter::repeat(b'a').take(padding_len));
163+
line.extend(std::iter::repeat_n(b'a', padding_len));
164164
line.extend_from_slice(suffix.as_bytes());
165165

166166
let mut data = Vec::with_capacity(line_len * lines);
@@ -174,7 +174,7 @@ fn burn_cpu_kb(bytes: u64, rounds: u32) {
174174
if bytes == 0 || rounds == 0 {
175175
return;
176176
}
177-
let kb = (bytes + BYTES_PER_KB - 1) / BYTES_PER_KB;
177+
let kb = bytes.div_ceil(BYTES_PER_KB);
178178
let mut checksum = 0u64;
179179
let mut remaining = kb.saturating_mul(rounds as u64);
180180
while remaining > 0 {

datafusion/datasource-json/src/boundary_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ mod tests {
350350
let body_len = line_len.saturating_sub(1);
351351
let mut data = Vec::with_capacity(line_len * lines);
352352
for _ in 0..lines {
353-
data.extend(std::iter::repeat(b'a').take(body_len));
353+
data.extend(std::iter::repeat_n(b'a', body_len));
354354
data.push(b'\n');
355355
}
356356
Bytes::from(data)

0 commit comments

Comments
 (0)