|
|
@@ -1,6 +1,5 @@
|
|
|
use std::io::{fs, IoResult};
|
|
|
use std::io;
|
|
|
-use std::str::from_utf8_lossy;
|
|
|
|
|
|
use ansi_term::{Paint, Colour, Plain, Style, Red, Green, Yellow, Blue, Purple, Cyan, Fixed};
|
|
|
|
|
|
@@ -32,7 +31,7 @@ pub struct File<'a> {
|
|
|
impl<'a> File<'a> {
|
|
|
pub fn from_path(path: &'a Path, parent: &'a Dir) -> IoResult<File<'a>> {
|
|
|
let v = path.filename().unwrap(); // fails if / or . or ..
|
|
|
- let filename = from_utf8_lossy(v).to_string();
|
|
|
+ let filename = String::from_utf8_lossy(v).to_string();
|
|
|
|
|
|
// Use lstat here instead of file.stat(), as it doesn't follow
|
|
|
// symbolic links. Otherwise, the stat() call will fail if it
|
|
|
@@ -160,7 +159,7 @@ impl<'a> File<'a> {
|
|
|
|
|
|
fn target_file_name_and_arrow(&self, target_path: Path) -> String {
|
|
|
let v = target_path.filename().unwrap();
|
|
|
- let filename = from_utf8_lossy(v).to_string();
|
|
|
+ let filename = String::from_utf8_lossy(v).to_string();
|
|
|
|
|
|
let link_target = fs::stat(&target_path).map(|stat| File {
|
|
|
path: &target_path,
|