fn rm_rf(&self) -> io::Result<()> {
        if self.c_exists() {
            for file in fs::read_dir(self).unwrap() {
                let file = try!(file).path();

                if file.c_is_dir() {
                    try!(file.rm_rf());
                } else {
                    // On windows we can't remove a readonly file, and git will
                    // often clone files as readonly. As a result, we have some
                    // special logic to remove readonly files on windows.
                    match fs::remove_file(&file) {
                        Ok(()) => {}
                        Err(ref e) if cfg!(windows) &&
                                      e.kind() == ErrorKind::PermissionDenied => {
                            let mut p = file.c_metadata().unwrap().permissions();
                            p.set_readonly(false);
                            fs::set_permissions(&file, p).unwrap();
                            try!(fs::remove_file(&file));
                        }
                        Err(e) => return Err(e)
                    }
                }
            }
            fs::remove_dir(self)
        } else {
            Ok(())
        }
    }
/* Technically there is a potential race condition, but we don't
     * care all that much for our tests
     */
Technically there is a potential race condition, but we don't
care all that much for our tests
Technically there is a potential race condition but we don ' t care all that much for our tests
fn rm_rf(&self) -> io::Result<()> {
        if self.c_exists() {
            for file in fs::read_dir(self).unwrap() {
                let file = try!(file).path();
                if file.c_is_dir() {
                    try!(file.rm_rf());
                } else {
                    // On windows we can't remove a readonly file, and git will
                    // often clone files as readonly. As a result, we have some
                    // special logic to remove readonly files on windows.
                    match fs::remove_file(&file) {
                        Ok(()) => {}
                        Err(ref e) if cfg!(windows) &&
                                      e.kind() == ErrorKind::PermissionDenied => {
                            let mut p = file.c_metadata().unwrap().permissions();
                            p.set_readonly(false);
                            fs::set_permissions(&file, p).unwrap();
                            try!(fs::remove_file(&file));
                        }
                        Err(e) => return Err(e)
                    }
                }
            }
            fs::remove_dir(self)
        } else {
            Ok(())
        }
    }
fn rm_rf ( & self ) -> io :: Result < ( ) > { if self . c_exists ( ) { for file in fs :: read_dir ( self ) . unwrap ( ) { let file = try ! ( file ) . path ( ) ; if file . c_is_dir ( ) { try ! ( file rm_rf ( ) ) ; } else { // On windows we can't remove a readonly file, and git will // often clone files as readonly. As a result, we have some // special logic to remove readonly files on windows. match fs :: remove_file ( & file ) { Ok ( ( ) ) => { } Err ( ref e ) if cfg ! ( windows ) && e . kind ( ) == ErrorKind :: PermissionDenied => { let mut p = file . c_metadata ( ) . unwrap ( ) . permissions ( ) ; p . set_readonly ( false ) ; fs :: set_permissions ( & file , p ) . unwrap ( ) ; try ! ( fs remove_file ( file ) ) ; } Err ( e ) => return Err ( e ) } } } fs :: remove_dir ( self ) } else { Ok ( ( ) ) } }
Technically there is a potential race condition, but we don't
 care all that much for our tests
Technically there is a potential race condition but we don ' t care all that much for our tests
&self
&self