Skip to content

Commit 287ea22

Browse files
author
Henrik Alsér
committed
cargo fmt
1 parent 4c935d0 commit 287ea22

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

nrf-hal-common/src/twim.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use crate::target::TWIM1;
1818

1919
use crate::{
2020
gpio::{Floating, Input, Pin},
21-
slice_in_ram_or,
22-
slice_in_ram,
21+
slice_in_ram, slice_in_ram_or,
2322
target_constants::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE},
2423
};
2524

@@ -349,10 +348,9 @@ where
349348
type Error = Error;
350349

351350
fn write<'w>(&mut self, addr: u8, bytes: &'w [u8]) -> Result<(), Error> {
352-
if slice_in_ram(bytes){
351+
if slice_in_ram(bytes) {
353352
self.write(addr, bytes)
354-
}
355-
else {
353+
} else {
356354
let buf = &mut [0; FORCE_COPY_BUFFER_SIZE][..];
357355
for chunk in bytes.chunks(FORCE_COPY_BUFFER_SIZE) {
358356
buf[..chunk.len()].copy_from_slice(chunk);
@@ -386,7 +384,7 @@ where
386384
bytes: &'w [u8],
387385
buffer: &'w mut [u8],
388386
) -> Result<(), Error> {
389-
if slice_in_ram(bytes){
387+
if slice_in_ram(bytes) {
390388
self.write_then_read(addr, bytes, buffer)
391389
} else {
392390
let txi = bytes.chunks(FORCE_COPY_BUFFER_SIZE);

0 commit comments

Comments
 (0)