Skip to content

Commit 6d7d35b

Browse files
committed
Formatting
1 parent bd038ff commit 6d7d35b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/i2c.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,9 @@ impl<I2C: Instance, A, R> I2cTarget<I2C, A, R> {
11311131
Ok(data) => {
11321132
*byte = data;
11331133
}
1134-
Err(Error::TargetError(TargetError::TransferStopped)) => return Ok(i),
1134+
Err(Error::TargetError(TargetError::TransferStopped)) => {
1135+
return Ok(i)
1136+
}
11351137
Err(error) => return Err(error),
11361138
};
11371139
}
@@ -1166,7 +1168,10 @@ impl<I2C: Instance, A, R> I2cTarget<I2C, A, R> {
11661168
// If we receive a NACK it will be on the FIFO write subsequent to the last byte
11671169
// actually written to the bus. If we start writing zeroes out, we only want to
11681170
// indicate how many bytes from the buffer we wrote.
1169-
return Ok(core::cmp::min(i.saturating_sub(1), bytes.len()));
1171+
return Ok(core::cmp::min(
1172+
i.saturating_sub(1),
1173+
bytes.len(),
1174+
));
11701175
}
11711176
Err(error) => return Err(error),
11721177
}
@@ -1467,7 +1472,9 @@ where
14671472
Err(Error::TargetError(TargetError::ControllerExpectedWrite))
14681473
}
14691474
TargetEvent::Write { address: _ } => self.read(buffer),
1470-
TargetEvent::Stop => Err(Error::TargetError(TargetError::TransferStopped)),
1475+
TargetEvent::Stop => {
1476+
Err(Error::TargetError(TargetError::TransferStopped))
1477+
}
14711478
}
14721479
}
14731480

@@ -1489,7 +1496,9 @@ where
14891496
TargetEvent::Write { address: _ } => {
14901497
Err(Error::TargetError(TargetError::ControllerExpectedRead))
14911498
}
1492-
TargetEvent::Stop => Err(Error::TargetError(TargetError::TransferStopped)),
1499+
TargetEvent::Stop => {
1500+
Err(Error::TargetError(TargetError::TransferStopped))
1501+
}
14931502
}
14941503
}
14951504

0 commit comments

Comments
 (0)