diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2015-09-15 00:11:45 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2015-09-15 00:11:45 +0200 |
commit | 3592d70fd18686ca984db32204e6dcccd05731eb (patch) | |
tree | 8761d095e0c4801554193a653076890b34f50bed | |
parent | ce3c1b9402393a3fd126433f1c67428c66c74a80 (diff) | |
download | vtcol-3592d70fd18686ca984db32204e6dcccd05731eb.tar.gz |
vtcol.rs: update for rustc 1.4
-rw-r--r-- | src/vtcol.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs index 03a8258..e4f0b06 100644 --- a/src/vtcol.rs +++ b/src/vtcol.rs @@ -1,13 +1,24 @@ #![feature(libc)] #![feature(rustc_private)] -#![feature(collections)] #![feature(convert)] +/* Core appears to require some extra handholding … + */ +#![feature(core)] +#![feature(core_slice_ext)] +#![feature(core_str_ext)] + extern crate libc; extern crate getopts; +extern crate core; use std::io::BufRead; +/* Various traits. + */ +use core::slice::SliceExt; +use core::str::StrExt; + type Fd = libc::c_int; static mut VERBOSITY : u8 = 0_u8; @@ -72,10 +83,8 @@ impl Color { s : &str) -> String { - if b { - return String::from_str("bright ") + s; - } - String::from_str(s) + if b { "bright ".to_string() + s } + else { s.to_string() } } fn |