simplify error handling code

confirmed that ignoring the error on a write is probably what we want --
it will truncate the string
This commit is contained in:
bunnie 2021-10-10 20:55:54 +08:00
parent 5fa8f2a6a3
commit e06d946bcd

View file

@ -69,10 +69,7 @@ impl XousLoggerBacking<'_> {
}
let mut wrapper = cursor::BufferWrapper::new(&mut log_record.args);
match write!(wrapper, "{}", record.args()) {
Ok(_) => {},
Err(_e) => {}, // if there's an error on the write, just silently discard it...
}
write!(wrapper, "{}", record.args()).ok(); // truncate if error
log_record.args_length = wrapper.len() as u32;
}