Skip to content

Commit 548006e

Browse files
committed
fix: fix clippy warnings
Signed-off-by: Walid Aliwi <walid.aliwi@stud.fils.upb.ro>
1 parent aed73d0 commit 548006e

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

tbf-parser/src/parse.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ pub fn parse_tbf_header(
203203
}
204204
types::TbfHeaderTypes::TbfHeaderWriteableFlashRegions => {
205205
// Length must be a multiple of the size of a region definition.
206-
if tlv_header.length as usize
207-
% mem::size_of::<types::TbfHeaderV2WriteableFlashRegion>()
208-
== 0
206+
if (tlv_header.length as usize).is_multiple_of(mem::size_of::<types::TbfHeaderV2WriteableFlashRegion>())
209207
{
210208
// Calculate how many writeable flash regions
211209
// there are specified in this header.

tockloader-lib/src/command_impl/probers/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl CommandInstall for ProbeRSConnection {
8282
// multiple types of page sizes. Possibly make page size a board
8383
// setting.
8484
let page_size = 512;
85-
let needs_padding = binary.len() % page_size != 0;
85+
let needs_padding = !binary.len().is_multiple_of(page_size);
8686

8787
if needs_padding {
8888
let remaining = page_size - (binary.len() % page_size);

0 commit comments

Comments
 (0)