]> git.lizzy.rs Git - rust.git/commitdiff
use a number for the maximum indentation instead of relying on str::len()
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 1 Jun 2016 15:58:50 +0000 (17:58 +0200)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 1 Jun 2016 15:58:50 +0000 (17:58 +0200)
src/bin/miri.rs

index 8039cd18f82c6d539d8cc6436bef289712e6abe9..85e4f6348690d2baa3434a609c729d7f185088a9 100644 (file)
@@ -44,8 +44,8 @@ fn init_logger() {
     let format = |record: &log::LogRecord| {
         // prepend spaces to indent the final string
         let indentation = log_settings::settings().indentation;
-        let spaces = "    |    |    |    |    |    |    |    |    ";
-        let indentation = &spaces[..std::cmp::min(indentation, spaces.len())];
+        let spaces = "    |    |    |    |    |    |    |    |    |";
+        let indentation = &spaces[..std::cmp::min(indentation, 44)];
         format!("{}:{}|{} {}", record.level(), record.location().module_path(), indentation, record.args())
     };