mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
du: remove some clones.
This commit is contained in:
parent
a4c40503be
commit
3c1466c4ed
1 changed files with 3 additions and 3 deletions
6
du/du.rs
6
du/du.rs
|
@ -80,7 +80,7 @@ fn du(path: &Path, options_arc: Arc<Options>, depth: uint) -> ~[Arc<FileStat>] {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args = os::args();
|
let args = os::args();
|
||||||
let program = args[0].clone();
|
let program = args[0].as_slice();
|
||||||
let opts = ~[
|
let opts = ~[
|
||||||
// In task
|
// In task
|
||||||
getopts::optflag("a", "all", " write counts for all files, not just directories"),
|
getopts::optflag("a", "all", " write counts for all files, not just directories"),
|
||||||
|
@ -299,8 +299,8 @@ Try '{program} --help' for more information.", s, program = program);
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut grand_total = 0;
|
let mut grand_total = 0;
|
||||||
for path_str in strs.iter() {
|
for path_str in strs.move_iter() {
|
||||||
let path = Path::new(path_str.clone());
|
let path = Path::new(path_str);
|
||||||
let iter = du(&path, options_arc.clone(), 0).move_iter();
|
let iter = du(&path, options_arc.clone(), 0).move_iter();
|
||||||
let (_, len) = iter.size_hint();
|
let (_, len) = iter.size_hint();
|
||||||
let len = len.unwrap();
|
let len = len.unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue