I like aligning things

This commit is contained in:
Ben S 2014-11-24 02:12:52 +00:00
parent d72be30c30
commit 5b7124bb71
6 changed files with 22 additions and 27 deletions

View File

@ -25,12 +25,8 @@ impl<'a> Dir<'a> {
for path in self.contents.iter() {
match File::from_path(path, self) {
Ok(file) => {
files.push(file);
}
Err(e) => {
println!("{}: {}", path.display(), e);
}
Ok(file) => files.push(file),
Err(e) => println!("{}: {}", path.display(), e),
}
}

View File

@ -52,7 +52,7 @@ impl Options {
getopts::optflag("l", "long", "display extended details and attributes"),
getopts::optflag("i", "inode", "show each file's inode number"),
getopts::optflag("r", "reverse", "reverse order of files"),
getopts::optopt("s", "sort", "field to sort by", "WORD"),
getopts::optopt ("s", "sort", "field to sort by", "WORD"),
getopts::optflag("S", "blocks", "show number of file system blocks"),
getopts::optflag("x", "across", "sort multi-column view entries across"),
];
@ -118,7 +118,8 @@ impl Options {
fn should_display(&self, f: &File) -> bool {
if self.show_invisibles {
true
} else {
}
else {
!f.name.as_slice().starts_with(".")
}
}

View File

@ -1,4 +1,3 @@
mod c {
#![allow(non_camel_case_types)]
extern crate libc;
@ -22,7 +21,6 @@ mod c {
// Unfortunately the actual command is not standardised...
#[cfg(any(target_os = "linux", target_os = "android"))]
static TIOCGWINSZ: c_ulong = 0x5413;
#[cfg(any(target_os = "macos", target_os = "ios"))]

View File

@ -116,7 +116,7 @@ impl Unix {
if username == ptr::null() {
return false;
}
if unsafe { from_buf(username as *const u8) } == *uname {
else if unsafe { from_buf(username as *const u8) } == *uname {
return true;
}
else {