about summary refs log tree commit diff
path: root/src/liblog
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-10 19:46:38 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-21 23:31:42 -0800
commit082bfde412176249dc7328e771a2a15d202824cf (patch)
tree4df3816d6ffea2f52bf5fa51fe385806ed529ba7 /src/liblog
parent4908017d59da8694b9ceaf743baf1163c1e19086 (diff)
downloadrust-082bfde412176249dc7328e771a2a15d202824cf.tar.gz
rust-082bfde412176249dc7328e771a2a15d202824cf.zip
Fallout of std::str stabilization
Diffstat (limited to 'src/liblog')
-rw-r--r--src/liblog/directive.rs2
-rw-r--r--src/liblog/lib.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/liblog/directive.rs b/src/liblog/directive.rs
index d1db0ec89a1..2b25a64affe 100644
--- a/src/liblog/directive.rs
+++ b/src/liblog/directive.rs
@@ -23,7 +23,7 @@ pub static LOG_LEVEL_NAMES: [&'static str, ..4] = ["ERROR", "WARN", "INFO",
 
 /// Parse an individual log level that is either a number or a symbolic log level
 fn parse_log_level(level: &str) -> Option<u32> {
-    from_str::<u32>(level).or_else(|| {
+    level.parse::<u32>().or_else(|| {
         let pos = LOG_LEVEL_NAMES.iter().position(|&name| name.eq_ignore_ascii_case(level));
         pos.map(|p| p as u32 + 1)
     }).map(|p| cmp::min(p, ::MAX_LOG_LEVEL))
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs
index 2bf9af90271..bc655c219f3 100644
--- a/src/liblog/lib.rs
+++ b/src/liblog/lib.rs
@@ -164,7 +164,7 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
        html_playground_url = "http://play.rust-lang.org/")]
-#![feature(macro_rules, unboxed_closures)]
+#![feature(macro_rules, unboxed_closures, slicing_syntax)]
 #![deny(missing_docs)]
 
 extern crate regex;
@@ -280,7 +280,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
     // Test the literal string from args against the current filter, if there
     // is one.
     match unsafe { FILTER.as_ref() } {
-        Some(filter) if !filter.is_match(args.to_string().as_slice()) => return,
+        Some(filter) if !filter.is_match(args.to_string()[]) => return,
         _ => {}
     }
 
@@ -375,7 +375,7 @@ fn enabled(level: u32,
     // Search for the longest match, the vector is assumed to be pre-sorted.
     for directive in iter.rev() {
         match directive.name {
-            Some(ref name) if !module.starts_with(name.as_slice()) => {},
+            Some(ref name) if !module.starts_with(name[]) => {},
             Some(..) | None => {
                 return level <= directive.level
             }
@@ -390,7 +390,7 @@ fn enabled(level: u32,
 /// `Once` primitive (and this function is called from that primitive).
 fn init() {
     let (mut directives, filter) = match os::getenv("RUST_LOG") {
-        Some(spec) => directive::parse_logging_spec(spec.as_slice()),
+        Some(spec) => directive::parse_logging_spec(spec[]),
         None => (Vec::new(), None),
     };