From cc0d8440240c5749a3640abe1e65aef3192da981 Mon Sep 17 00:00:00 2001 From: Lotte Steenbrink Date: Fri, 3 Jul 2020 17:00:01 +0200 Subject: [PATCH] run cargo fmt --- advanced/firmware/src/bin/usb-2-solution.rs | 6 ++---- advanced/firmware/src/bin/usb-3-solution.rs | 7 ++++--- advanced/firmware/src/bin/usb-3.rs | 6 ++++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/advanced/firmware/src/bin/usb-2-solution.rs b/advanced/firmware/src/bin/usb-2-solution.rs index 8494098..a49c948 100644 --- a/advanced/firmware/src/bin/usb-2-solution.rs +++ b/advanced/firmware/src/bin/usb-2-solution.rs @@ -20,9 +20,7 @@ const APP: () = { usbd::init(board.power, &board.usbd); - init::LateResources { - usbd: board.usbd, - } + init::LateResources { usbd: board.usbd } } #[task(binds = USBD, resources = [usbd])] @@ -79,7 +77,7 @@ fn on_event(usbd: &USBD, event: Event) { // On Mac OS you'll get this request before the GET_DESCRIPTOR request so we // need to catch it here. We'll properly handle this request later // but for now it's OK to do nothing. - }, + } _ => unreachable!(), // we don't handle any other Requests } } diff --git a/advanced/firmware/src/bin/usb-3-solution.rs b/advanced/firmware/src/bin/usb-3-solution.rs index 6739de4..31b4ab4 100644 --- a/advanced/firmware/src/bin/usb-3-solution.rs +++ b/advanced/firmware/src/bin/usb-3-solution.rs @@ -86,8 +86,7 @@ fn on_event(usbd: &USBD, ep0in: &mut Ep0In, event: Event) { idVendor: consts::VID, }; let desc_bytes = desc.bytes(); - let resp = - &desc_bytes[..core::cmp::min(desc_bytes.len(), usize::from(length))]; + let resp = &desc_bytes[..core::cmp::min(desc_bytes.len(), usize::from(length))]; ep0in.start(&resp, usbd); } Request::SetAddress { .. } => { @@ -96,7 +95,9 @@ fn on_event(usbd: &USBD, ep0in: &mut Ep0In, event: Event) { // but for now it's OK to do nothing. } _ => { - log::error!("unknown request (goal achieved if GET_DESCRIPTOR Device was handled)"); + log::error!( + "unknown request (goal achieved if GET_DESCRIPTOR Device was handled)" + ); dk::exit() } } diff --git a/advanced/firmware/src/bin/usb-3.rs b/advanced/firmware/src/bin/usb-3.rs index f2f0471..9a43ccb 100644 --- a/advanced/firmware/src/bin/usb-3.rs +++ b/advanced/firmware/src/bin/usb-3.rs @@ -81,9 +81,11 @@ fn on_event(usbd: &USBD, ep0in: &mut Ep0In, event: Event) { // On Mac OS you'll get this request before the GET_DESCRIPTOR request so we // need to catch it here. We'll properly handle this request later // but for now it's OK to do nothing. - }, + } _ => { - log::error!("unknown request (goal achieved if GET_DESCRIPTOR Device was handled)"); + log::error!( + "unknown request (goal achieved if GET_DESCRIPTOR Device was handled)" + ); dk::exit() } }