fn from_str(advisory_id: &str) -> Result<Self, Error> {
        if advisory_id == PLACEHOLDER {
            return Ok(Id::default());
        }

        let kind = Kind::detect(advisory_id);

        // Ensure known advisory types are well-formed
        let year = match kind {
            Kind::RustSec | Kind::Cve | Kind::Talos => Some(parse_year(advisory_id)?),
            _ => None,
        };

        Ok(Self {
            kind,
            year,
            string: advisory_id.into(),
        })
    }
/// Create an `Id` from the given string
Create an `Id` from the given string
Create an ` Id ` from the given string
fn from_str(advisory_id: &str) -> Result<Self, Error> {
        if advisory_id == PLACEHOLDER {
            return Ok(Id::default());
        }
        let kind = Kind::detect(advisory_id);
        // Ensure known advisory types are well-formed
        let year = match kind {
            Kind::RustSec | Kind::Cve | Kind::Talos => Some(parse_year(advisory_id)?),
            _ => None,
        };
        Ok(Self {
            kind,
            year,
            string: advisory_id.into(),
        })
    }
fn from_str ( advisory_id : & str ) -> Result < Self , Error > { if advisory_id == PLACEHOLDER { return Ok ( Id :: default ( ) ) ; } let kind = Kind :: detect ( advisory_id ) ; // Ensure known advisory types are well-formed let year = match kind { Kind :: RustSec | Kind :: Cve | Kind :: Talos => Some ( parse_year ( advisory_id ) ? ) , _ => None , } ; Ok ( Self { kind , year , string : advisory_id . into ( ) , } ) }
Create an `Id` from the given string
Create an ` Id ` from the given string
advisory_id
&str
advisory_id
&str