Răsfoiți Sursa

Upgrade to latest Rust

- Feature flags changes (old_io, old_path)
- Slice syntax changes ([] -> [..])
Ben S 11 ani în urmă
părinte
comite
b2ed264ba4
3 a modificat fișierele cu 8 adăugiri și 8 ștergeri
  1. 4 4
      src/file.rs
  2. 3 3
      src/main.rs
  3. 1 1
      src/output/details.rs

+ 4 - 4
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(),
                     }
                 }

+ 3 - 3
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);

+ 1 - 1
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 {