Explorar o código

Upgrade to latest ansi_term

Changes to the way ANSIStrings work mean we need to dereference the strings before putting them in an ANSIString. There's more that can be done here, but this gets it to compile for now.
Ben S %!s(int64=10) %!d(string=hai) anos
pai
achega
63bd929eb5
Modificáronse 4 ficheiros con 11 adicións e 11 borrados
  1. 2 2
      Cargo.lock
  2. 1 1
      Cargo.toml
  3. 2 2
      src/output/grid.rs
  4. 6 6
      src/output/mod.rs

+ 2 - 2
Cargo.lock

@@ -2,7 +2,7 @@
 name = "exa"
 name = "exa"
 version = "0.4.0"
 version = "0.4.0"
 dependencies = [
 dependencies = [
- "ansi_term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ansi_term 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "datetime 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "datetime 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -37,7 +37,7 @@ dependencies = [
 
 
 [[package]]
 [[package]]
 name = "ansi_term"
 name = "ansi_term"
-version = "0.5.2"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 
 [[package]]
 [[package]]

+ 1 - 1
Cargo.toml

@@ -7,7 +7,7 @@ authors = [ "ogham@bsago.me" ]
 name = "exa"
 name = "exa"
 
 
 [dependencies]
 [dependencies]
-ansi_term = "0.5.0"
+ansi_term = "0.7.0"
 bitflags = "0.1"
 bitflags = "0.1"
 datetime = "0.4.1"
 datetime = "0.4.1"
 getopts = "0.2.1"
 getopts = "0.2.1"

+ 2 - 2
src/output/grid.rs

@@ -26,7 +26,7 @@ impl Grid {
 
 
         for file in files.iter() {
         for file in files.iter() {
             grid.add(grid::Cell {
             grid.add(grid::Cell {
-                contents:  file_colour(&self.colours, file).paint(&file.name).to_string(),
+                contents:  file_colour(&self.colours, file).paint(&*file.name).to_string(),
                 width:     file.file_name_width(),
                 width:     file.file_name_width(),
             });
             });
         }
         }
@@ -37,7 +37,7 @@ impl Grid {
         else {
         else {
             // File names too long for a grid - drop down to just listing them!
             // File names too long for a grid - drop down to just listing them!
             for file in files.iter() {
             for file in files.iter() {
-                println!("{}", file_colour(&self.colours, file).paint(&file.name));
+                println!("{}", file_colour(&self.colours, file).paint(&*file.name));
             }
             }
         }
         }
     }
     }

+ 6 - 6
src/output/mod.rs

@@ -20,21 +20,21 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> String {
     }
     }
     else {
     else {
         let style = file_colour(colours, file);
         let style = file_colour(colours, file);
-        style.paint(&file.name).to_string()
+        style.paint(&*file.name).to_string()
     }
     }
 }
 }
 
 
 fn symlink_filename(file: &File, colours: &Colours) -> String {
 fn symlink_filename(file: &File, colours: &Colours) -> String {
     match file.link_target() {
     match file.link_target() {
         Ok(target) => format!("{} {} {}",
         Ok(target) => format!("{} {} {}",
-                              file_colour(colours, file).paint(&file.name),
+                              file_colour(colours, file).paint(&*file.name),
                               colours.punctuation.paint("->"),
                               colours.punctuation.paint("->"),
-                              ANSIStrings(&[ colours.symlink_path.paint(&target.path_prefix()),
-                                             file_colour(colours, &target).paint(&target.name) ])),
+                              ANSIStrings(&[ colours.symlink_path.paint(target.path_prefix()),
+                                             file_colour(colours, &target).paint(target.name) ])),
 
 
         Err(filename) => format!("{} {} {}",
         Err(filename) => format!("{} {} {}",
-                                 file_colour(colours, file).paint(&file.name),
+                                 file_colour(colours, file).paint(&*file.name),
                                  colours.broken_arrow.paint("->"),
                                  colours.broken_arrow.paint("->"),
-                                 colours.broken_filename.paint(&filename)),
+                                 colours.broken_filename.paint(filename)),
     }
     }
 }
 }