Skip to content

Commit

Permalink
Run Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmortsell committed Dec 18, 2023
1 parent 7f3e7ee commit 58e2e44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
8 changes: 2 additions & 6 deletions hal/src/serial/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,12 @@ impl SpiConfiguration {
}

/// Generates a default [`Spi`] configuration: test mode inactive.
impl Default for SpiConfiguration{
impl Default for SpiConfiguration {
fn default() -> Self {
SpiConfiguration { test_mode: false }
}
}


/// SPI peripheral abstraction.
pub struct Spi<M: SpiMeta> {
meta: PhantomData<M>,
Expand Down Expand Up @@ -642,10 +641,7 @@ impl<'spi, M: SpiMeta> blocking::spi::Transactional<u8> for Client<'spi, M> {

/// Execute the provided transactions, deasserting the select line
/// after the last transmitted word.
fn exec(
&mut self,
operations: &mut [blocking::spi::Operation<u8>],
) -> Result<(), Self::Error> {
fn exec(&mut self, operations: &mut [blocking::spi::Operation<u8>]) -> Result<(), Self::Error> {
use blocking::spi::Operation;

let len = operations.len();
Expand Down
5 changes: 1 addition & 4 deletions hal/src/serial/usart/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ impl<M: UsartMeta, R: SpiRole> ehal::spi::FullDuplex<u8> for Spi<M, R> {
impl<M: UsartMeta, R: SpiRole> blocking::spi::Transactional<u8> for Spi<M, R> {
type Error = SpiError;

fn exec(
&mut self,
operations: &mut [blocking::spi::Operation<u8>],
) -> Result<(), Self::Error> {
fn exec(&mut self, operations: &mut [blocking::spi::Operation<u8>]) -> Result<(), Self::Error> {
use blocking::spi::Operation;

for o in operations.iter_mut() {
Expand Down
6 changes: 1 addition & 5 deletions hal/src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ impl Inner {
#[inline(always)]
fn write_fifo(&self, ep: usize, buf: &[u8]) {
unsafe {
core::ptr::copy_nonoverlapping(
buf.as_ptr(),
self.fifo_addr(ep) as *mut u8,
buf.len(),
);
core::ptr::copy_nonoverlapping(buf.as_ptr(), self.fifo_addr(ep) as *mut u8, buf.len());
}
}

Expand Down

0 comments on commit 58e2e44

Please sign in to comment.