pub fn is_lossy<P: AsRef<Path>>(p: P) -> Option<bool> {
        p.as_ref()
            .extension()
            .and_then(std::ffi::OsStr::to_str)
            .map(|ext| match ext.to_lowercase().as_str() {
                "jpg" | "jpeg" => Some(true),
                "png" => Some(false),
                "gif" => Some(false),
                "bmp" => Some(false),
                _ => None,
            })
            .unwrap_or(None)
    }
/// Looks at file's extension and, if it's a supported image format, returns whether the format is lossless
Looks at file's extension and, if it's a supported image format, returns whether the format is lossless
Looks at file ' s extension and if it ' s a supported image format returns whether the format is lossless
pub fn is_lossy<P: AsRef<Path>>(p: P) -> Option<bool> {
        p.as_ref()
            .extension()
            .and_then(std::ffi::OsStr::to_str)
            .map(|ext| match ext.to_lowercase().as_str() {
                "jpg" | "jpeg" => Some(true),
                "png" => Some(false),
                "gif" => Some(false),
                "bmp" => Some(false),
                _ => None,
            })
            .unwrap_or(None)
    }
pub fn is_lossy < P : AsRef < Path > > ( p : P ) -> Option < bool > { p . as_ref ( ) . extension ( ) . and_then ( std :: ffi :: OsStr :: to_str ) . map ( | ext | match ext . to_lowercase ( ) . as_str ( ) { " " | " " => Some ( true ) , " " => Some ( false ) , " " => Some ( false ) , " " => Some ( false ) , _ => None , } ) . unwrap_or ( None ) }
Looks at file's extension and, if it's a supported image format, returns whether the format is lossless
Looks at file ' s extension and if it ' s a supported image format returns whether the format is lossless
p
P
p
P