summaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2015-11-03 11:17:44 +0000
committerBen S <ogham@bsago.me>2015-11-03 11:17:44 +0000
commit63bd929eb5bf08ca9c9b57fd1d886839536332a4 (patch)
treec3772ca3e93476a29270f1f1a6b02fa3c93e7423 /src/output
parentbc47073281ada9e9e8dec208b28d629d787cef1f (diff)
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.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/grid.rs4
-rw-r--r--src/output/mod.rs12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/output/grid.rs b/src/output/grid.rs
index 0fd0af4..13d2f8d 100644
--- a/src/output/grid.rs
+++ b/src/output/grid.rs
@@ -26,7 +26,7 @@ impl Grid {
for file in files.iter() {
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(),
});
}
@@ -37,7 +37,7 @@ impl Grid {
else {
// File names too long for a grid - drop down to just listing them!
for file in files.iter() {
- println!("{}", file_colour(&self.colours, file).paint(&file.name));
+ println!("{}", file_colour(&self.colours, file).paint(&*file.name));
}
}
}
diff --git a/src/output/mod.rs b/src/output/mod.rs
index 4205852..5a3fb31 100644
--- a/src/output/mod.rs
+++ b/src/output/mod.rs
@@ -20,21 +20,21 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> String {
}
else {
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 {
match file.link_target() {
Ok(target) => format!("{} {} {}",
- file_colour(colours, file).paint(&file.name),
+ file_colour(colours, file).paint(&*file.name),
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!("{} {} {}",
- file_colour(colours, file).paint(&file.name),
+ file_colour(colours, file).paint(&*file.name),
colours.broken_arrow.paint("->"),
- colours.broken_filename.paint(&filename)),
+ colours.broken_filename.paint(filename)),
}
}