Use OS-defined permission bits type

This commit is contained in:
Ben S 2015-05-03 16:35:44 +01:00
parent ffcc6fa179
commit 42a347c063
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ use std::env::current_dir;
use std::fs;
use std::io;
use std::os::unix;
use std::os::unix::raw::mode_t;
use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::{Component, Path, PathBuf};
@ -423,7 +424,7 @@ impl<'a> File<'a> {
}
/// Helper method for the permissions string.
fn permission_bit(bits: u16, bit: u16, character: &'static str, style: Style) -> ANSIString<'static> {
fn permission_bit(bits: mode_t, bit: mode_t, character: &'static str, style: Style) -> ANSIString<'static> {
let bi32 = bit as u16;
if bits & bi32 == bi32 {
style.paint(character)

View File

@ -1,5 +1,5 @@
#![feature(collections, convert, core, exit_status, file_type, fs_ext, fs_mode)]
#![feature(libc, metadata_ext, scoped, symlink_metadata)]
#![feature(libc, metadata_ext, raw_ext, scoped, symlink_metadata)]
extern crate ansi_term;
extern crate datetime;