From 90099f28cfa31af316f78ee3a5c1ab536d680fd3 Mon Sep 17 00:00:00 2001 From: Ben S Date: Thu, 10 Jul 2014 22:20:52 +0100 Subject: [PATCH] Upgrade to latest Rust nightly - change to_string() on numbers to to_str() --- README.md | 2 +- src/file.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 94e65db..799e2f4 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,4 @@ Options Installation ------------ -exa is written in [Rust](http://www.rust-lang.org). It compiles with Rust 0.11, the latest version - 0.10 will not do, as there have been too many breaking changes since. You will also need [Cargo](http://crates.io), the Rust package manager. Once you have them both set up, a simple `cargo build` will pull in all the dependencies and compile exa. +exa is written in [Rust](http://www.rust-lang.org). You'll have to use the nightly -- I try to keep it up to date with the latest version when possible. You will also need [Cargo](http://crates.io), the Rust package manager. Once you have them both set up, a simple `cargo build` will pull in all the dependencies and compile exa. diff --git a/src/file.rs b/src/file.rs index 8ea24b2..4a218ae 100644 --- a/src/file.rs +++ b/src/file.rs @@ -109,13 +109,13 @@ impl<'a> File<'a> { // the time. HardLinks => { let style = if self.stat.kind == io::TypeFile && self.stat.unstable.nlink > 1 { Red.on(Yellow) } else { Red.normal() }; - style.paint(self.stat.unstable.nlink.to_str().as_slice()) + style.paint(self.stat.unstable.nlink.to_string().as_slice()) }, - Inode => Purple.paint(self.stat.unstable.inode.to_str().as_slice()), + Inode => Purple.paint(self.stat.unstable.inode.to_string().as_slice()), Blocks => { if self.stat.kind == io::TypeFile || self.stat.kind == io::TypeSymlink { - Cyan.paint(self.stat.unstable.blocks.to_str().as_slice()) + Cyan.paint(self.stat.unstable.blocks.to_string().as_slice()) } else { Grey.paint("-") @@ -128,13 +128,13 @@ impl<'a> File<'a> { let uid = self.stat.unstable.uid as u32; unix.load_user(uid); let style = if unix.uid == uid { Yellow.bold() } else { Plain }; - let string = unix.get_user_name(uid).unwrap_or(uid.to_str()); + let string = unix.get_user_name(uid).unwrap_or(uid.to_string()); style.paint(string.as_slice()) }, Group => { let gid = self.stat.unstable.gid as u32; unix.load_group(gid); - let name = unix.get_group_name(gid).unwrap_or(gid.to_str()); + let name = unix.get_group_name(gid).unwrap_or(gid.to_string()); let style = if unix.is_group_member(gid) { Yellow.normal() } else { Plain }; style.paint(name.as_slice()) },