Remove a few more istr conversions. Issue #855
This commit is contained in:
parent
7924368268
commit
91ea2577cd
2 changed files with 10 additions and 10 deletions
|
@ -183,23 +183,23 @@ fn run_tests_console_(opts: &test_opts, tests: &[test_desc],
|
|||
ret success;
|
||||
|
||||
fn write_ok(out: &io::writer, use_color: bool) {
|
||||
write_pretty(out, "ok", term::color_green, use_color);
|
||||
write_pretty(out, ~"ok", term::color_green, use_color);
|
||||
}
|
||||
|
||||
fn write_failed(out: &io::writer, use_color: bool) {
|
||||
write_pretty(out, "FAILED", term::color_red, use_color);
|
||||
write_pretty(out, ~"FAILED", term::color_red, use_color);
|
||||
}
|
||||
|
||||
fn write_ignored(out: &io::writer, use_color: bool) {
|
||||
write_pretty(out, "ignored", term::color_yellow, use_color);
|
||||
write_pretty(out, ~"ignored", term::color_yellow, use_color);
|
||||
}
|
||||
|
||||
fn write_pretty(out: &io::writer, word: &str, color: u8,
|
||||
fn write_pretty(out: &io::writer, word: &istr, color: u8,
|
||||
use_color: bool) {
|
||||
if use_color && term::color_supported() {
|
||||
term::fg(out.get_buf_writer(), color);
|
||||
}
|
||||
out.write_str(istr::from_estr(word));
|
||||
out.write_str(word);
|
||||
if use_color && term::color_supported() {
|
||||
term::reset(out.get_buf_writer());
|
||||
}
|
||||
|
|
|
@ -100,11 +100,11 @@ fn str_opt(maybestr: &istr) -> option::t<istr> {
|
|||
}
|
||||
|
||||
fn str_mode(s: &istr) -> mode {
|
||||
alt istr::to_estr(s) {
|
||||
"compile-fail" { mode_compile_fail }
|
||||
"run-fail" { mode_run_fail }
|
||||
"run-pass" { mode_run_pass }
|
||||
"pretty" { mode_pretty }
|
||||
alt s {
|
||||
~"compile-fail" { mode_compile_fail }
|
||||
~"run-fail" { mode_run_fail }
|
||||
~"run-pass" { mode_run_pass }
|
||||
~"pretty" { mode_pretty }
|
||||
_ { fail "invalid mode" }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue