std: Replace for with do { .. } expr where internal iterators are used

This commit is contained in:
blake2-ppc
2013-07-31 21:07:44 +02:00
parent 02bdf90cf6
commit b18bd785ec
9 changed files with 94 additions and 76 deletions

View File

@@ -790,7 +790,7 @@ pub fn list_dir_path(p: &Path) -> ~[Path] {
/// all its contents. Use carefully!
pub fn remove_dir_recursive(p: &Path) -> bool {
let mut error_happened = false;
for walk_dir(p) |inner| {
do walk_dir(p) |inner| {
if !error_happened {
if path_is_dir(inner) {
if !remove_dir_recursive(inner) {
@@ -803,6 +803,7 @@ pub fn remove_dir_recursive(p: &Path) -> bool {
}
}
}
true
};
// Directory should now be empty
!error_happened && remove_dir(p)