fn check_filename(file: &Path) -> CargoResult<()> {
    let name = match file.file_name() {
        Some(name) => name,
        None => return Ok(()),
    };
    let name = match name.to_str() {
        Some(name) => name,
        None => {
            bail!("path does not have a unicode filename which may not unpack \
                   on all platforms: {}", file.display())
        }
    };
    let bad_chars = ['/', '\\', '<', '>', ':', '"', '|', '?', '*'];
    for c in bad_chars.iter().filter(|c| name.contains(**c)) {
        bail!("cannot package a filename with a special character `{}`: {}",
              c, file.display())
    }
    Ok(())
}
// It can often be the case that files of a particular name on one platform
// can't actually be created on another platform. For example files with colons
// in the name are allowed on Unix but not on Windows.
//
// To help out in situations like this, issue about weird filenames when
// packaging as a "heads up" that something may not work on other platforms.
It can often be the case that files of a particular name on one platform
can't actually be created on another platform. For example files with colons
in the name are allowed on Unix but not on Windows.

To help out in situations like this, issue about weird filenames when
packaging as a "heads up" that something may not work on other platforms.
It can often be the case that files of a particular name on one platform can ' t actually be created on another platform . For example files with colons in the name are allowed on Unix but not on Windows . To help out in situations like this issue about weird filenames when packaging as a " heads up " that something may not work on other platforms .
fn check_filename(file: &Path) -> CargoResult<()> {
    let name = match file.file_name() {
        Some(name) => name,
        None => return Ok(()),
    };
    let name = match name.to_str() {
        Some(name) => name,
        None => {
            bail!("path does not have a unicode filename which may not unpack \
                   on all platforms: {}", file.display())
        }
    };
    let bad_chars = ['/', '\\', '<', '>', ':', '"', '|', '?', '*'];
    for c in bad_chars.iter().filter(|c| name.contains(**c)) {
        bail!("cannot package a filename with a special character `{}`: {}",
              c, file.display())
    }
    Ok(())
}
fn check_filename ( file : & Path ) -> CargoResult < ( ) > { let name = match file . file_name ( ) { Some ( name ) => name , None => return Ok ( ( ) ) , } ; let name = match name . to_str ( ) { Some ( name ) => name , None => { bail ! ( " \
 " file display ( ) ) } } ; let bad_chars = [ '/' , '\\' , '<' , '>' , ':' , '"' , '|' , '?' , '*' ] ; for c in bad_chars . iter ( ) . filter ( | c | name . contains ( * * c ) ) { bail ! ( " " c file display ( ) ) } Ok ( ( ) ) }
It can often be the case that files of a particular name on one platform
can't actually be created on another platform.
It can often be the case that files of a particular name on one platform can ' t actually be created on another platform .
file
&Path
file
&Path