Skip to content

Commit ad84af5

Browse files
clippy: prefering repeat_n instead of repeat
``` error: this `repeat().take()` can be written more concisely --> lightning-invoice/src/ser.rs:256:12 | 256 | Box::new(core::iter::repeat(Fe32::Q).take(to_pad).chain(fes)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `core::iter::repeat_n(Fe32::Q, to_pad)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n = note: `-D clippy::manual-repeat-n` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_repeat_n)]` ``` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
1 parent c4d23bc commit ad84af5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning-invoice/src/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Base32Iterable for PositiveTimestamp {
253253
let fes = encode_int_be_base32(self.as_unix_timestamp());
254254
debug_assert!(fes.len() <= 7, "Invalid timestamp length");
255255
let to_pad = 7 - fes.len();
256-
Box::new(core::iter::repeat(Fe32::Q).take(to_pad).chain(fes))
256+
Box::new(core::iter::repeat_n(Fe32::Q, to_pad).chain(fes))
257257
}
258258
}
259259

0 commit comments

Comments
 (0)