File tree Expand file tree Collapse file tree
tockloader-lib/src/command_impl/probers Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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) ;
You can’t perform that action at this time.
0 commit comments