Skip to content

Commit

Permalink
Remove the unnecessary local variable in set_logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Oct 14, 2015
1 parent b38b9e1 commit 695c958
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/liblog/lib.rs
Expand Up @@ -328,8 +328,7 @@ pub fn log_level() -> u32 {
/// Replaces the thread-local logger with the specified logger, returning the old
/// logger.
pub fn set_logger(logger: Box<Logger + Send>) -> Option<Box<Logger + Send>> {
let mut l = Some(logger);
LOCAL_LOGGER.with(|slot| mem::replace(&mut *slot.borrow_mut(), l.take()))
LOCAL_LOGGER.with(|slot| mem::replace(&mut *slot.borrow_mut(), Some(logger)))
}

/// A LogRecord is created by the logging macros, and passed as the only
Expand Down

0 comments on commit 695c958

Please sign in to comment.