@@ -64,9 +64,9 @@ impl Mode {
64
64
}
65
65
66
66
pub fn get_frequency ( & self ) -> Hertz {
67
- match self {
68
- & Mode :: Standard { frequency } => frequency,
69
- & Mode :: Fast { frequency, .. } => frequency,
67
+ match * self {
68
+ Mode :: Standard { frequency } => frequency,
69
+ Mode :: Fast { frequency, .. } => frequency,
70
70
}
71
71
}
72
72
}
@@ -211,13 +211,13 @@ fn blocking_i2c<I2C, PINS>(
211
211
data_timeout_us : u32 ,
212
212
) -> BlockingI2c < I2C , PINS > {
213
213
let sysclk_mhz = clocks. sysclk ( ) . 0 / 1_000_000 ;
214
- return BlockingI2c {
214
+ BlockingI2c {
215
215
nb : i2c,
216
216
start_timeout : start_timeout_us * sysclk_mhz,
217
217
start_retries,
218
218
addr_timeout : addr_timeout_us * sysclk_mhz,
219
219
data_timeout : data_timeout_us * sysclk_mhz,
220
- } ;
220
+ }
221
221
}
222
222
223
223
macro_rules! wait_for_flag {
@@ -317,8 +317,8 @@ macro_rules! hal {
317
317
318
318
self . i2c. ccr. write( |w| {
319
319
let ( freq, duty) = match duty_cycle {
320
- & DutyCycle :: Ratio2to1 => ( ( ( self . pclk1 / ( freq. 0 * 3 ) ) as u16 ) . max( 1 ) , false ) ,
321
- & DutyCycle :: Ratio16to9 => ( ( ( self . pclk1 / ( freq. 0 * 25 ) ) as u16 ) . max( 1 ) , true )
320
+ DutyCycle :: Ratio2to1 => ( ( ( self . pclk1 / ( freq. 0 * 3 ) ) as u16 ) . max( 1 ) , false ) ,
321
+ DutyCycle :: Ratio16to9 => ( ( ( self . pclk1 / ( freq. 0 * 25 ) ) as u16 ) . max( 1 ) , true )
322
322
} ;
323
323
324
324
unsafe {
@@ -403,7 +403,7 @@ macro_rules! hal {
403
403
while retries_left > 0 {
404
404
self . nb. send_start( ) ;
405
405
last_ret = busy_wait_cycles!( self . nb. wait_after_sent_start( ) , self . start_timeout) ;
406
- if let Err ( _ ) = last_ret {
406
+ if last_ret . is_err ( ) {
407
407
self . nb. reset( ) ;
408
408
} else {
409
409
break ;
0 commit comments