We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b38b9e1 commit 695c958Copy full SHA for 695c958
src/liblog/lib.rs
@@ -328,8 +328,7 @@ pub fn log_level() -> u32 {
328
/// Replaces the thread-local logger with the specified logger, returning the old
329
/// logger.
330
pub fn set_logger(logger: Box<Logger + Send>) -> Option<Box<Logger + Send>> {
331
- let mut l = Some(logger);
332
- LOCAL_LOGGER.with(|slot| mem::replace(&mut *slot.borrow_mut(), l.take()))
+ LOCAL_LOGGER.with(|slot| mem::replace(&mut *slot.borrow_mut(), Some(logger)))
333
}
334
335
/// A LogRecord is created by the logging macros, and passed as the only
0 commit comments