From 818fc615a877f9f8ca3d58aceeba891050c9b2a7 Mon Sep 17 00:00:00 2001 From: Ben S Date: Thu, 22 May 2014 00:16:05 +0100 Subject: [PATCH] Upgrade to latest Rust nightly --- exa.rs | 8 +++++--- file.rs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/exa.rs b/exa.rs index 4108318..ca28d73 100644 --- a/exa.rs +++ b/exa.rs @@ -16,8 +16,10 @@ struct Options { } fn main() { - let args = os::args(); - let program = args[0].as_slice(); + let args: Vec = os::args().iter() + .map(|x| x.to_strbuf()) + .collect(); + let opts = ~[ getopts::optflag("a", "all", "show dot-files") ]; @@ -32,7 +34,7 @@ fn main() { }; let strs = if matches.free.is_empty() { - vec!("./".to_owned()) + vec!("./".to_strbuf()) } else { matches.free.clone() diff --git a/file.rs b/file.rs index 66f2810..6db7206 100644 --- a/file.rs +++ b/file.rs @@ -74,7 +74,7 @@ impl<'a> File<'a> { fn file_colour(&self) -> Style { if self.stat.kind == io::TypeDirectory { Blue.normal() - } else if self.stat.perm & io::UserExecute == io::UserExecute { + } else if self.stat.perm.contains(io::UserExecute) { Green.normal() } else if self.name.ends_with("~") { Black.bold() @@ -100,8 +100,8 @@ impl<'a> File<'a> { } } -fn bit(bits: u32, bit: u32, other: &'static str, style: Style) -> ~str { - if bits & bit == bit { +fn bit(bits: io::FilePermission, bit: io::FilePermission, other: &'static str, style: Style) -> ~str { + if bits.contains(bit) { style.paint(other.to_owned()) } else { Black.bold().paint("-".to_owned()) -- GitLab