Rollup merge of #33898 - srinivasreddy:rustfmt_liblog, r=Manishearth

rustfmt on liblog
This commit is contained in:
Guillaume Gomez 2016-05-27 10:50:05 +02:00
commit 2c4fd94636

View File

@ -179,7 +179,7 @@ use std::io::prelude::*;
use std::mem; use std::mem;
use std::env; use std::env;
use std::slice; use std::slice;
use std::sync::{Once, Mutex, ONCE_INIT}; use std::sync::{Mutex, ONCE_INIT, Once};
use directive::LOG_LEVEL_NAMES; use directive::LOG_LEVEL_NAMES;
@ -290,9 +290,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
// frob the slot while we're doing the logging. This will destroy any logger // frob the slot while we're doing the logging. This will destroy any logger
// set during logging. // set during logging.
let logger = LOCAL_LOGGER.with(|s| s.borrow_mut().take()); let logger = LOCAL_LOGGER.with(|s| s.borrow_mut().take());
let mut logger = logger.unwrap_or_else(|| { let mut logger = logger.unwrap_or_else(|| Box::new(DefaultLogger { handle: io::stderr() }));
Box::new(DefaultLogger { handle: io::stderr() })
});
logger.log(&LogRecord { logger.log(&LogRecord {
level: LogLevel(level), level: LogLevel(level),
args: args, args: args,