File tree 11 files changed +16
-13
lines changed
11 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 27
27
fail-fast : false
28
28
matrix :
29
29
platform :
30
- - os : " macos-12 "
30
+ - os : " macos-13 "
31
31
target : " x86_64-apple-darwin"
32
32
arch : " x86_64"
33
33
- os : " ubuntu-22.04"
Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ jobs:
32
32
target : " x86_64-pc-windows-msvc"
33
33
arch : " x86_64"
34
34
# macOs
35
- - os : " macos-12 "
35
+ - os : " macos-13 "
36
36
target : " aarch64-apple-darwin"
37
37
# This is not true, but simplifies the logic of the action.
38
38
arch : " x86_64"
39
- - os : " macos-12 "
39
+ - os : " macos-13 "
40
40
target : " x86_64-apple-darwin"
41
41
arch : " x86_64"
42
42
runs-on : ${{ matrix.platform.os }}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
- Allow ` partition_table_offset ` to be specified in the config file. (for #699 )
13
13
- Support external log-processors (#705 )
14
+ - Address Clippy lints (#710 )
14
15
15
16
### Changed
16
17
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ pub enum Command<'a> {
192
192
FlashDetect ,
193
193
}
194
194
195
- impl < ' a > Command < ' a > {
195
+ impl Command < ' _ > {
196
196
/// Return the command type
197
197
pub fn command_type ( & self ) -> CommandType {
198
198
match self {
Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ mod encoder {
515
515
}
516
516
}
517
517
518
- impl < ' a , W : Write > Write for SlipEncoder < ' a , W > {
518
+ impl < W : Write > Write for SlipEncoder < ' _ , W > {
519
519
/// Writes the given buffer replacing the END and ESC bytes
520
520
///
521
521
/// See https://docs.espressif.com/projects/esptool/en/latest/esp32c3/advanced-topics/serial-protocol.html#low-level-protocol
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ pub fn soft_reset(
253
253
connection. with_timeout ( CommandType :: FlashBegin . timeout ( ) , |connection| {
254
254
let size: u32 = 0 ;
255
255
let offset: u32 = 0 ;
256
- let blocks: u32 = ( size + FLASH_WRITE_SIZE as u32 - 1 ) / FLASH_WRITE_SIZE as u32 ;
256
+ let blocks: u32 = size. div_ceil ( FLASH_WRITE_SIZE as u32 ) ;
257
257
connection. command ( Command :: FlashBegin {
258
258
size,
259
259
blocks,
@@ -271,7 +271,7 @@ pub fn soft_reset(
271
271
connection. with_timeout ( CommandType :: FlashBegin . timeout ( ) , |connection| {
272
272
let size: u32 = 0 ;
273
273
let offset: u32 = 0 ;
274
- let blocks: u32 = ( size + FLASH_WRITE_SIZE as u32 - 1 ) / FLASH_WRITE_SIZE as u32 ;
274
+ let blocks: u32 = size. div_ceil ( FLASH_WRITE_SIZE as u32 ) ;
275
275
connection. command ( Command :: FlashBegin {
276
276
size,
277
277
blocks,
Original file line number Diff line number Diff line change @@ -184,15 +184,15 @@ impl<'a> CodeSegment<'a> {
184
184
}
185
185
}
186
186
187
- impl < ' a > AddAssign < & ' _ [ u8 ] > for CodeSegment < ' a > {
187
+ impl AddAssign < & ' _ [ u8 ] > for CodeSegment < ' _ > {
188
188
fn add_assign ( & mut self , rhs : & ' _ [ u8 ] ) {
189
189
let mut data = take ( & mut self . data ) . into_owned ( ) ;
190
190
data. extend_from_slice ( rhs) ;
191
191
self . data = Cow :: Owned ( data) ;
192
192
}
193
193
}
194
194
195
- impl < ' a > AddAssign < & ' _ CodeSegment < ' _ > > for CodeSegment < ' a > {
195
+ impl AddAssign < & ' _ CodeSegment < ' _ > > for CodeSegment < ' _ > {
196
196
fn add_assign ( & mut self , rhs : & ' _ CodeSegment < ' _ > ) {
197
197
let mut data = take ( & mut self . data ) . into_owned ( ) ;
198
198
// pad or truncate
Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ pub struct FlashDataBuilder<'a> {
302
302
min_chip_rev : u16 ,
303
303
}
304
304
305
- impl < ' a > Default for FlashDataBuilder < ' a > {
305
+ impl Default for FlashDataBuilder < ' _ > {
306
306
fn default ( ) -> Self {
307
307
Self {
308
308
bootloader_path : Default :: default ( ) ,
@@ -567,6 +567,7 @@ pub struct Flasher {
567
567
568
568
#[ cfg( feature = "serialport" ) ]
569
569
impl Flasher {
570
+ #[ allow( clippy:: too_many_arguments) ]
570
571
pub fn connect (
571
572
serial : Port ,
572
573
port_info : UsbPortInfo ,
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ pub struct IdfBootloaderFormat<'a> {
113
113
}
114
114
115
115
impl < ' a > IdfBootloaderFormat < ' a > {
116
+ #[ allow( clippy:: too_many_arguments) ]
116
117
pub fn new (
117
118
image : & ' a dyn FirmwareImage < ' a > ,
118
119
chip : Chip ,
Original file line number Diff line number Diff line change @@ -170,8 +170,8 @@ impl FlashTarget for Esp32Target {
170
170
171
171
let target = self . chip . into_target ( ) ;
172
172
let flash_write_size = target. flash_write_size ( connection) ?;
173
- let block_count = ( compressed. len ( ) + flash_write_size - 1 ) / flash_write_size ;
174
- let erase_count = ( segment. data . len ( ) + FLASH_SECTOR_SIZE - 1 ) / FLASH_SECTOR_SIZE ;
173
+ let block_count = compressed. len ( ) . div_ceil ( flash_write_size) ;
174
+ let erase_count = segment. data . len ( ) . div_ceil ( FLASH_SECTOR_SIZE ) ;
175
175
176
176
// round up to sector size
177
177
let erase_size = ( erase_count * FLASH_SECTOR_SIZE ) as u32 ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl FlashTarget for RamTarget {
42
42
let addr = segment. addr ;
43
43
44
44
let padding = 4 - segment. data . len ( ) % 4 ;
45
- let block_count = ( segment. data . len ( ) + padding + self . block_size - 1 ) / self . block_size ;
45
+ let block_count = ( segment. data . len ( ) + padding) . div_ceil ( self . block_size ) ;
46
46
47
47
connection. command ( Command :: MemBegin {
48
48
size : segment. data . len ( ) as u32 ,
You can’t perform that action at this time.
0 commit comments