summaryrefslogtreecommitdiffstats
path: root/usb/src/logger.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usb/src/logger.rs')
-rw-r--r--usb/src/logger.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/usb/src/logger.rs b/usb/src/logger.rs
index 7357c22..170607c 100644
--- a/usb/src/logger.rs
+++ b/usb/src/logger.rs
@@ -20,14 +20,14 @@ struct JoinedRingBuffer<'a> {
impl<'a> JoinedRingBuffer<'a> {
const fn new(rb: &'a RingBuffer<u8>) -> Self {
let (lbr, lbw) = rb.split();
- Self { lbr: lbr, lbw: lbw }
+ Self { lbr, lbw }
}
}
impl fmt::Write for JoinedRingBuffer<'_> {
fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> {
for b in s.bytes() {
- if let Err(_) = self.lbw.unshift(b) {
+ if self.lbw.unshift(b).is_err() {
// Ignore buffer full errors for logging.
return Ok(());
}
@@ -93,9 +93,9 @@ where
}
let jrb = unsafe { &mut JRB };
- write!(
+ writeln!(
jrb,
- "[{}] {} {} -- {}\r\n",
+ "[{}] {} {} -- {}\r",
rtc::millis(),
record.level(),
record.target(),