]> git.lizzy.rs Git - rust.git/blobdiff - src/libterm/lib.rs
test: Make manual changes to deal with the fallout from removal of
[rust.git] / src / libterm / lib.rs
index 3584d2bd162284a8276bdc006fc45eed0c31c827..3148c9233ff2d7b4ea0018ec08af84ede6e902db 100644 (file)
@@ -24,8 +24,8 @@
 
 extern crate collections;
 
-use std::os;
 use std::io;
+use std::os;
 use terminfo::TermInfo;
 use terminfo::searcher::open;
 use terminfo::parser::compiled::{parse, msys_terminfo};
@@ -149,10 +149,14 @@ pub fn new(out: T) -> Result<Terminal<T>, ~str> {
     pub fn fg(&mut self, color: color::Color) -> io::IoResult<bool> {
         let color = self.dim_if_necessary(color);
         if self.num_colors > color {
-            let s = expand(*self.ti.strings.find_equiv(&("setaf")).unwrap(),
+            let s = expand(self.ti
+                               .strings
+                               .find_equiv(&("setaf"))
+                               .unwrap()
+                               .as_slice(),
                            [Number(color as int)], &mut Variables::new());
             if s.is_ok() {
-                try!(self.out.write(s.unwrap()));
+                try!(self.out.write(s.unwrap().as_slice()));
                 return Ok(true)
             }
         }
@@ -168,10 +172,14 @@ pub fn fg(&mut self, color: color::Color) -> io::IoResult<bool> {
     pub fn bg(&mut self, color: color::Color) -> io::IoResult<bool> {
         let color = self.dim_if_necessary(color);
         if self.num_colors > color {
-            let s = expand(*self.ti.strings.find_equiv(&("setab")).unwrap(),
+            let s = expand(self.ti
+                               .strings
+                               .find_equiv(&("setab"))
+                               .unwrap()
+                               .as_slice(),
                            [Number(color as int)], &mut Variables::new());
             if s.is_ok() {
-                try!(self.out.write(s.unwrap()));
+                try!(self.out.write(s.unwrap().as_slice()));
                 return Ok(true)
             }
         }
@@ -189,9 +197,11 @@ pub fn attr(&mut self, attr: attr::Attr) -> io::IoResult<bool> {
                 let cap = cap_for_attr(attr);
                 let parm = self.ti.strings.find_equiv(&cap);
                 if parm.is_some() {
-                    let s = expand(*parm.unwrap(), [], &mut Variables::new());
+                    let s = expand(parm.unwrap().as_slice(),
+                                   [],
+                                   &mut Variables::new());
                     if s.is_ok() {
-                        try!(self.out.write(s.unwrap()));
+                        try!(self.out.write(s.unwrap().as_slice()));
                         return Ok(true)
                     }
                 }
@@ -225,10 +235,10 @@ pub fn reset(&mut self) -> io::IoResult<()> {
             }
         }
         let s = cap.map_or(Err(~"can't find terminfo capability `sgr0`"), |op| {
-            expand(*op, [], &mut Variables::new())
+            expand(op.as_slice(), [], &mut Variables::new())
         });
         if s.is_ok() {
-            return self.out.write(s.unwrap())
+            return self.out.write(s.unwrap().as_slice())
         }
         Ok(())
     }