summaryrefslogtreecommitdiffstats
path: root/src/filetype.rs
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2014-11-23 21:29:11 +0000
committerBen S <ogham@bsago.me>2014-11-23 21:29:11 +0000
commit933f98d2c3734a69260b6d10ae059130417ae813 (patch)
tree8eedebcd31602a20eb15f5b1a0bf2100472f4e27 /src/filetype.rs
parent26f8ad08bf508bfab78fc17a477ed839960634f5 (diff)
Upgrade to latest Rust nightly
Diffstat (limited to 'src/filetype.rs')
-rw-r--r--src/filetype.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/filetype.rs b/src/filetype.rs
index 4bd3983..31b23ce 100644
--- a/src/filetype.rs
+++ b/src/filetype.rs
@@ -1,10 +1,10 @@
-use file::File;
-use std::io;
-use std::ascii::StrAsciiExt;
+use file::{File, GREY};
+use self::FileType::*;
-use ansi_term::{Paint, Colour, Plain, Style, Red, Green, Yellow, Blue, Cyan, Fixed};
+use std::io;
+use std::ascii::AsciiExt;
-static Grey: Colour = Fixed(244);
+use ansi_term::{Paint, Plain, Style, Red, Green, Yellow, Blue, Cyan, Fixed};
pub enum FileType {
Normal, Directory, Executable, Immediate, Compiled, Symlink, Special,
@@ -64,7 +64,7 @@ impl FileType {
Crypto => Fixed(109).normal(),
Document => Fixed(105).normal(),
Compressed => Red.normal(),
- Temp => Grey.normal(),
+ Temp => GREY.normal(),
Immediate => Yellow.bold().underline(),
Compiled => Fixed(137).normal(),
}
@@ -87,14 +87,14 @@ impl<'a> HasType for File<'a> {
else if self.stat.kind == io::TypeBlockSpecial || self.stat.kind == io::TypeNamedPipe || self.stat.kind == io::TypeUnknown {
return Special;
}
- else if self.stat.perm.contains(io::UserExecute) {
+ else if self.stat.perm.contains(io::USER_EXECUTE) {
return Executable;
}
else if name.starts_with("README") || BUILD_TYPES.iter().any(|&s| s == name) {
return Immediate;
}
else if self.ext.is_some() {
- let e = self.ext.clone().unwrap().as_slice().to_ascii_lower();
+ let e = self.ext.clone().unwrap().to_ascii_lower();
let ext = e.as_slice();
if IMAGE_TYPES.iter().any(|&s| s == ext) {
return Image;