mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-04-07 16:01:52 +00:00
Remove a few deprecated constructs
The language keeps changing when I'm not looking!
This commit is contained in:
parent
a2e9144866
commit
b0c51d93f8
@ -40,7 +40,7 @@ fn exa(opts: &Options) {
|
|||||||
// more than one of them.
|
// more than one of them.
|
||||||
let print_dir_names = opts.dirs.len() > 1;
|
let print_dir_names = opts.dirs.len() > 1;
|
||||||
|
|
||||||
for dir_name in opts.dirs.clone().move_iter() {
|
for dir_name in opts.dirs.clone().into_iter() {
|
||||||
if first {
|
if first {
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ fn details_view(options: &Options, columns: &Vec<Column>, files: Vec<&File>) {
|
|||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if options.header {
|
if options.header {
|
||||||
table.unshift(columns.iter().map(|c| Plain.underline().paint(c.header())).collect());
|
table.insert(0, columns.iter().map(|c| Plain.underline().paint(c.header())).collect());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Each column needs to have its invisible colour-formatting
|
// Each column needs to have its invisible colour-formatting
|
||||||
|
@ -21,7 +21,7 @@ fn format_bytes(mut amount: f64, kilo: f64, prefixes: &[&str]) -> (String, Strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case_functions)]
|
#[allow(non_snake_case)]
|
||||||
pub fn format_IEC_bytes(amount: u64) -> (String, String) {
|
pub fn format_IEC_bytes(amount: u64) -> (String, String) {
|
||||||
format_bytes(amount as f64, 1024.0, IEC_PREFIXES)
|
format_bytes(amount as f64, 1024.0, IEC_PREFIXES)
|
||||||
}
|
}
|
||||||
|
@ -76,15 +76,15 @@ impl Unix {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_user_name(&self, uid: u32) -> Option<String> {
|
pub fn get_user_name(&self, uid: u32) -> Option<String> {
|
||||||
self.user_names.get(&uid).clone()
|
self.user_names[uid].clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_group_name(&self, gid: u32) -> Option<String> {
|
pub fn get_group_name(&self, gid: u32) -> Option<String> {
|
||||||
self.group_names.get(&gid).clone()
|
self.group_names[gid].clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_group_member(&self, gid: u32) -> bool {
|
pub fn is_group_member(&self, gid: u32) -> bool {
|
||||||
*self.groups.get(&gid)
|
self.groups[gid]
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_user(&mut self, uid: u32) {
|
pub fn load_user(&mut self, uid: u32) {
|
||||||
@ -108,7 +108,7 @@ impl Unix {
|
|||||||
// The second call will return None if it's a null pointer.
|
// The second call will return None if it's a null pointer.
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
match unsafe { group.offset(i).to_option().unwrap().to_option() } {
|
match unsafe { group.offset(i).as_ref().unwrap().as_ref() } {
|
||||||
Some(username) => {
|
Some(username) => {
|
||||||
if unsafe { from_c_str(username) } == *uname {
|
if unsafe { from_c_str(username) } == *uname {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user