summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs4
-rw-r--r--src/ui.rs8
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 4f6a41f..d553d9f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -35,9 +35,9 @@
while_true,
)]
-extern crate log as logcrate;
-
#![allow(macro_use_extern_crate)]
+
+extern crate log as logcrate;
#[macro_use] extern crate diesel;
use std::path::Path;
diff --git a/src/ui.rs b/src/ui.rs
index 7b73e92..0b95403 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -147,12 +147,10 @@ pub fn script_to_printable(script: &Script, highlight: bool, highlight_theme: &s
} else {
script.lines()?.join("")
}
+ } else if line_numbers {
+ script.lines_numbered().map(|(i, s)| format!("{:>4} | {}", i, s)).join("")
} else {
- if line_numbers {
- script.lines_numbered().map(|(i, s)| format!("{:>4} | {}", i, s)).join("")
- } else {
- script.to_string()
- }
+ script.to_string()
};
Ok(script)