pub fn parse(source: &[u8]) -> Result<Self, AllowListError> {
        let contents = std::str::from_utf8(source)?
            .split("\n")
            .filter(|line| !(line.is_empty() || line.starts_with("#")))
            .map(PackageName::from_str)
            .collect::<Result<HashSet<_>, _>>()?;
        return Ok(Self { contents });
    }
/// Parses a `NonStaticAllowList` from a utf8-encoded list of package names, separated with \n.
/// Ignores empty lines and lines beginning with '#'.
Parses a `NonStaticAllowList` from a utf8-encoded list of package names, separated with \n.
Ignores empty lines and lines beginning with '#'.
Parses a ` NonStaticAllowList ` from a utf8 - encoded list of package names separated with \ n . Ignores empty lines and lines beginning with ' # ' .
pub fn parse(source: &[u8]) -> Result<Self, AllowListError> {
        let contents = std::str::from_utf8(source)?
            .split("\n")
            .filter(|line| !(line.is_empty() || line.starts_with("#")))
            .map(PackageName::from_str)
            .collect::<Result<HashSet<_>, _>>()?;
        return Ok(Self { contents });
    }
pub fn parse ( source : & [ u8 ] ) -> Result < Self , AllowListError > { let contents = std :: str :: from_utf8 ( source ) ? . split ( " \n " ) . filter ( | line | ! ( line . is_empty ( ) || line . starts_with ( " " ) ) ) . map ( PackageName :: from_str ) . collect :: < Result < HashSet < _ > , _ > > ( ) ? ; return Ok ( Self { contents } ) ; }
Parses a `NonStaticAllowList` from a utf8-encoded list of package names, separated with \n.
Parses a ` NonStaticAllowList ` from a utf8 - encoded list of package names separated with \ n .
source
&[u8]
source
&[u8]