pub fn remove<F: AsRef<Path>>(path: F) {
    match fs::symlink_metadata(path.as_ref()) {
        Ok(file) => {
            if file.file_type().is_dir() {
                print!("{} is dir or symlink", path.as_ref().display());
                match fs::remove_dir_all(&path) {
                    Ok(_) => { println!("test: removed directory '{}'",
                                        path.as_ref().as_str().paint(Color::Green))
                    },
                    Err(_) => { println!("test: unable to remove directory '{}'",
                                         path.as_ref().as_str().paint(Color::Red))
                    },
                };
            } else if file.file_type().is_file() || file.file_type().is_symlink() {
                match fs::remove_file(&path) {
                    Ok(_) => { println!("test: removed file '{}'",
                                        path.as_ref().as_str().paint(Color::Green))
                    },
                    Err(_) => { println!("test: unable to remove file '{}'",
                                         path.as_ref().as_str().paint(Color::Red))
                    },
                };
            }
        },
        Err(e) => { panic!("{}", e.to_string()); },
    };
}
/// Removes a directory or file and all of its contents.
///
/// # Example
/// ```should_panic
/// use rpf::test;
///
/// test::remove("does_not_exist");
/// ```
Removes a directory or file and all of its contents.
Removes a directory or file and all of its contents .
pub fn remove<F: AsRef<Path>>(path: F) {
    match fs::symlink_metadata(path.as_ref()) {
        Ok(file) => {
            if file.file_type().is_dir() {
                print!("{} is dir or symlink", path.as_ref().display());
                match fs::remove_dir_all(&path) {
                    Ok(_) => { println!("test: removed directory '{}'",
                                        path.as_ref().as_str().paint(Color::Green))
                    },
                    Err(_) => { println!("test: unable to remove directory '{}'",
                                         path.as_ref().as_str().paint(Color::Red))
                    },
                };
            } else if file.file_type().is_file() || file.file_type().is_symlink() {
                match fs::remove_file(&path) {
                    Ok(_) => { println!("test: removed file '{}'",
                                        path.as_ref().as_str().paint(Color::Green))
                    },
                    Err(_) => { println!("test: unable to remove file '{}'",
                                         path.as_ref().as_str().paint(Color::Red))
                    },
                };
            }
        },
        Err(e) => { panic!("{}", e.to_string()); },
    };
}
pub fn remove < F : AsRef < Path > > ( path : F ) { match fs :: symlink_metadata ( path . as_ref ( ) ) { Ok ( file ) => { if file . file_type ( ) . is_dir ( ) { print ! ( " " path as_ref ( ) display ( ) ) ; match fs :: remove_dir_all ( & path ) { Ok ( _ ) => { println ! ( " " path as_ref ( ) as_str ( ) paint ( Color Green ) ) } , Err ( _ ) => { println ! ( " " path as_ref ( ) as_str ( ) paint ( Color Red ) ) } , } ; } else if file . file_type ( ) . is_file ( ) || file . file_type ( ) . is_symlink ( ) { match fs :: remove_file ( & path ) { Ok ( _ ) => { println ! ( " " path as_ref ( ) as_str ( ) paint ( Color Green ) ) } , Err ( _ ) => { println ! ( " " path as_ref ( ) as_str ( ) paint ( Color Red ) ) } , } ; } } , Err ( e ) => { panic ! ( " " e to_string ( ) ) ; } , } ; }
Removes a directory or file and all of its contents.
Removes a directory or file and all of its contents .
path
F
path
F
example
```should_panic
use rpf::test.


` ` ` should_panic use rpf :: test .