@@ -64,9 +64,9 @@ impl Mode {
6464 }
6565
6666 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,
7070 }
7171 }
7272}
@@ -211,13 +211,13 @@ fn blocking_i2c<I2C, PINS>(
211211 data_timeout_us : u32 ,
212212) -> BlockingI2c < I2C , PINS > {
213213 let sysclk_mhz = clocks. sysclk ( ) . 0 / 1_000_000 ;
214- return BlockingI2c {
214+ BlockingI2c {
215215 nb : i2c,
216216 start_timeout : start_timeout_us * sysclk_mhz,
217217 start_retries,
218218 addr_timeout : addr_timeout_us * sysclk_mhz,
219219 data_timeout : data_timeout_us * sysclk_mhz,
220- } ;
220+ }
221221}
222222
223223macro_rules! wait_for_flag {
@@ -317,8 +317,8 @@ macro_rules! hal {
317317
318318 self . i2c. ccr. write( |w| {
319319 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 )
322322 } ;
323323
324324 unsafe {
@@ -403,7 +403,7 @@ macro_rules! hal {
403403 while retries_left > 0 {
404404 self . nb. send_start( ) ;
405405 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 ( ) {
407407 self . nb. reset( ) ;
408408 } else {
409409 break ;
0 commit comments