Skip to content

Commit 043096e

Browse files
committed
stdlib: Remove exterior vectors from termivec
1 parent f7a1006 commit 043096e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/lib/termivec.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ fn reset(ioivec::buf_writer writer) {
4848
}
4949

5050
fn color_supported() -> bool {
51-
auto supported_terms = ["xterm-color", "xterm", "screen-bce"];
51+
auto supported_terms = ~["xterm-color", "xterm", "screen-bce"];
5252
ret alt (generic_os::getenv("TERM")) {
53-
case (option::some(?env)) { vec::member(env, supported_terms) }
54-
case (option::none) { false }
53+
case (option::some(?env)) {
54+
for (str term in supported_terms) {
55+
if (str::eq(term, env)) { true }
56+
}
57+
false
58+
}
59+
case (option::none) { false }
5560
};
5661
}
5762

0 commit comments

Comments
 (0)