From b2ed264ba44744245026d815c443ffd55909aacd Mon Sep 17 00:00:00 2001 From: Ben S Date: Sat, 21 Feb 2015 13:54:35 +0000 Subject: [PATCH] Upgrade to latest Rust - Feature flags changes (old_io, old_path) - Slice syntax changes ([] -> [..]) --- src/file.rs | 8 ++++---- src/main.rs | 6 +++--- src/output/details.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/file.rs b/src/file.rs index 5119493..32a6e53 100644 --- a/src/file.rs +++ b/src/file.rs @@ -205,7 +205,7 @@ impl<'a> File<'a> { /// This file's number of hard links as a coloured string. fn hard_links(&self, locale: &locale::Numeric) -> Cell { let style = if self.has_multiple_links() { Red.on(Yellow) } else { Red.normal() }; - Cell::paint(style, &locale.format_int(self.stat.unstable.nlink as isize)[]) + Cell::paint(style, &locale.format_int(self.stat.unstable.nlink as isize)[..]) } /// Whether this is a regular file with more than one link. @@ -225,7 +225,7 @@ impl<'a> File<'a> { /// This file's number of filesystem blocks (if available) as a coloured string. fn blocks(&self, locale: &locale::Numeric) -> Cell { if self.stat.kind == io::FileType::RegularFile || self.stat.kind == io::FileType::Symlink { - Cell::paint(Cyan.normal(), &locale.format_int(self.stat.unstable.blocks as isize)[]) + Cell::paint(Cyan.normal(), &locale.format_int(self.stat.unstable.blocks as isize)[..]) } else { Cell { text: GREY.paint("-").to_string(), length: 1 } @@ -286,7 +286,7 @@ impl<'a> File<'a> { let result = match size_format { SizeFormat::DecimalBytes => decimal_prefix(self.stat.size as f64), SizeFormat::BinaryBytes => binary_prefix(self.stat.size as f64), - SizeFormat::JustBytes => return Cell::paint(Green.bold(), &locale.format_int(self.stat.size as isize)[]), + SizeFormat::JustBytes => return Cell::paint(Green.bold(), &locale.format_int(self.stat.size as isize)[..]), }; match result { @@ -296,7 +296,7 @@ impl<'a> File<'a> { let symbol = prefix.symbol(); Cell { - text: ANSIStrings( &[ Green.bold().paint(&number[]), Green.paint(symbol) ]).to_string(), + text: ANSIStrings( &[ Green.bold().paint(&number[..]), Green.paint(symbol) ]).to_string(), length: number.len() + symbol.len(), } } diff --git a/src/main.rs b/src/main.rs index 0745c0b..5c3dc08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -#![feature(collections, core, env, io, libc, path, plugin, std_misc)] +#![feature(collections, core, env, libc, old_io, old_path, plugin)] extern crate ansi_term; extern crate datetime; @@ -74,7 +74,7 @@ impl<'a> Exa<'a> { fn print_files(&self) { if !self.files.is_empty() { - self.print(None, &self.files[]); + self.print(None, &self.files[..]); } } @@ -118,7 +118,7 @@ impl<'a> Exa<'a> { } self.count += 1; - self.print(Some(dir), &files[]); + self.print(Some(dir), &files[..]); } Err(e) => { println!("{}: {}", dir_path.display(), e); diff --git a/src/output/details.rs b/src/output/details.rs index a48b9c3..8009a2a 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -28,7 +28,7 @@ impl Details { let locale = UserLocale::new(); let mut cache = OSUsers::empty_cache(); let mut table = Vec::new(); - self.get_files(&columns[], &mut cache, &locale, &mut table, files, 0); + self.get_files(&columns[..], &mut cache, &locale, &mut table, files, 0); if self.header { let row = Row {