//! # Examples
//!
//! ```
+//! # #![feature(rustc_private)]
//! #[macro_use] extern crate log;
//!
//! fn main() {
#![unstable(feature = "rustc_private",
reason = "use the crates.io `log` library instead",
issue = "27812")]
-#![staged_api]
+#![cfg_attr(stage0, staged_api)]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/",
- html_playground_url = "https://play.rust-lang.org/")]
+ html_playground_url = "https://play.rust-lang.org/",
+ test(attr(deny(warnings))))]
#![deny(missing_docs)]
#![feature(box_syntax)]
#![feature(const_fn)]
-#![feature(iter_cmp)]
#![feature(staged_api)]
#![feature(static_mutex)]
n => {
let filter = mem::transmute::<_, &String>(n);
if !args.to_string().contains(filter) {
- return
+ return;
}
}
}
// check being expanded manually in the logging macro, this function checks
// the log level again.
if level > unsafe { LOG_LEVEL } {
- return false
+ return false;
}
// This assertion should never get tripped unless we're in an at_exit
for directive in iter.rev() {
match directive.name {
Some(ref name) if !module.starts_with(&name[..]) => {}
- Some(..) | None => {
- return level <= directive.level
- }
+ Some(..) | None => return level <= directive.level,
}
}
level <= DEFAULT_LOG_LEVEL
});
let max_level = {
- let max = directives.iter().max_by(|d| d.level);
+ let max = directives.iter().max_by_key(|d| d.level);
max.map(|d| d.level).unwrap_or(DEFAULT_LOG_LEVEL)
};