diff options
author | Brian Cully <bjc@kublai.com> | 2019-09-09 21:38:46 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-09-09 21:38:46 -0400 |
commit | f0f38c61ff48453feef34b74d882466cd18d455f (patch) | |
tree | 07ec248a048ae41f752c33662e29d0d2a65edfb9 /usb/src/logger.rs | |
parent | e2dc05433490b2cc553387382bf44ee7d9529f28 (diff) | |
download | bleusb-master.tar.gz bleusb-master.zip |
Diffstat (limited to 'usb/src/logger.rs')
-rw-r--r-- | usb/src/logger.rs | 8 |
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(), |