mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-23 12:32:00 +00:00
Upgrade to latest Rust
- Feature flags changes (old_io, old_path) - Slice syntax changes ([] -> [..])
This commit is contained in:
parent
e15f72f049
commit
b2ed264ba4
@ -205,7 +205,7 @@ impl<'a> File<'a> {
|
|||||||
/// This file's number of hard links as a coloured string.
|
/// This file's number of hard links as a coloured string.
|
||||||
fn hard_links(&self, locale: &locale::Numeric) -> Cell {
|
fn hard_links(&self, locale: &locale::Numeric) -> Cell {
|
||||||
let style = if self.has_multiple_links() { Red.on(Yellow) } else { Red.normal() };
|
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.
|
/// 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.
|
/// This file's number of filesystem blocks (if available) as a coloured string.
|
||||||
fn blocks(&self, locale: &locale::Numeric) -> Cell {
|
fn blocks(&self, locale: &locale::Numeric) -> Cell {
|
||||||
if self.stat.kind == io::FileType::RegularFile || self.stat.kind == io::FileType::Symlink {
|
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 {
|
else {
|
||||||
Cell { text: GREY.paint("-").to_string(), length: 1 }
|
Cell { text: GREY.paint("-").to_string(), length: 1 }
|
||||||
@ -286,7 +286,7 @@ impl<'a> File<'a> {
|
|||||||
let result = match size_format {
|
let result = match size_format {
|
||||||
SizeFormat::DecimalBytes => decimal_prefix(self.stat.size as f64),
|
SizeFormat::DecimalBytes => decimal_prefix(self.stat.size as f64),
|
||||||
SizeFormat::BinaryBytes => binary_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 {
|
match result {
|
||||||
@ -296,7 +296,7 @@ impl<'a> File<'a> {
|
|||||||
let symbol = prefix.symbol();
|
let symbol = prefix.symbol();
|
||||||
|
|
||||||
Cell {
|
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(),
|
length: number.len() + symbol.len(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 ansi_term;
|
||||||
extern crate datetime;
|
extern crate datetime;
|
||||||
@ -74,7 +74,7 @@ impl<'a> Exa<'a> {
|
|||||||
|
|
||||||
fn print_files(&self) {
|
fn print_files(&self) {
|
||||||
if !self.files.is_empty() {
|
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.count += 1;
|
||||||
|
|
||||||
self.print(Some(dir), &files[]);
|
self.print(Some(dir), &files[..]);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("{}: {}", dir_path.display(), e);
|
println!("{}: {}", dir_path.display(), e);
|
||||||
|
@ -28,7 +28,7 @@ impl Details {
|
|||||||
let locale = UserLocale::new();
|
let locale = UserLocale::new();
|
||||||
let mut cache = OSUsers::empty_cache();
|
let mut cache = OSUsers::empty_cache();
|
||||||
let mut table = Vec::new();
|
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 {
|
if self.header {
|
||||||
let row = Row {
|
let row = Row {
|
||||||
|
Loading…
Reference in New Issue
Block a user