pub fn lint_file<P: AsRef<Path>>(path: P) -> Result<Self, crate::Error> {
        let path = path.as_ref();

        match path.extension().and_then(|ext| ext.to_str()) {
            Some("md") => (),
            other => fail!(
                crate::ErrorKind::Parse,
                "invalid advisory file extension: {}",
                other.unwrap_or("(missing)")
            ),
        }

        let advisory_data = fs::read_to_string(path).map_err(|e| {
            format_err!(
                crate::ErrorKind::Io,
                "couldn't open {}: {}",
                path.display(),
                e
            )
        })?;

        Self::lint_string(&advisory_data)
    }
/// Lint the advisory TOML file located at the given path
Lint the advisory TOML file located at the given path
Lint the advisory TOML file located at the given path
pub fn lint_file<P: AsRef<Path>>(path: P) -> Result<Self, crate::Error> {
        let path = path.as_ref();
        match path.extension().and_then(|ext| ext.to_str()) {
            Some("md") => (),
            other => fail!(
                crate::ErrorKind::Parse,
                "invalid advisory file extension: {}",
                other.unwrap_or("(missing)")
            ),
        }
        let advisory_data = fs::read_to_string(path).map_err(|e| {
            format_err!(
                crate::ErrorKind::Io,
                "couldn't open {}: {}",
                path.display(),
                e
            )
        })?;
        Self::lint_string(&advisory_data)
    }
pub fn lint_file < P : AsRef < Path > > ( path : P ) -> Result < Self , crate :: Error > { let path = path . as_ref ( ) ; match path . extension ( ) . and_then ( | ext | ext . to_str ( ) ) { Some ( " " ) => ( ) , other => fail ! ( crate ErrorKind Parse " " other unwrap_or ( " " ) ) , } let advisory_data = fs :: read_to_string ( path ) . map_err ( | e | { format_err ! ( crate ErrorKind Io " " path display ( ) e ) } ) ? ; Self :: lint_string ( & advisory_data ) }
Lint the advisory TOML file located at the given path
Lint the advisory TOML file located at the given path
path
P
path
P