pub fn parse(content: &str) -> Result<Theme> {
        let theme = match content.parse::<Toml>() {
            Ok(t) => t,
            Err(e) => bail!(e),
        };

        let mut extra = HashMap::new();
        if let Some(theme_table) = theme.as_table() {
            if let Some(ex) = theme_table.get("extra") {
                if ex.is_table() {
                    extra = ex.clone().try_into().unwrap();
                }
            }
        } else {
            bail!("Expected the `theme.toml` to be a TOML table")
        }

        Ok(Theme { extra })
    }
/// Parses a TOML string to our Theme struct
Parses a TOML string to our Theme struct
Parses a TOML string to our Theme struct
pub fn parse(content: &str) -> Result<Theme> {
        let theme = match content.parse::<Toml>() {
            Ok(t) => t,
            Err(e) => bail!(e),
        };
        let mut extra = HashMap::new();
        if let Some(theme_table) = theme.as_table() {
            if let Some(ex) = theme_table.get("extra") {
                if ex.is_table() {
                    extra = ex.clone().try_into().unwrap();
                }
            }
        } else {
            bail!("Expected the `theme.toml` to be a TOML table")
        }
        Ok(Theme { extra })
    }
pub fn parse ( content : & str ) -> Result < Theme > { let theme = match content . parse :: < Toml > ( ) { Ok ( t ) => t , Err ( e ) => bail ! ( e ) , } ; let mut extra = HashMap :: new ( ) ; if let Some ( theme_table ) = theme . as_table ( ) { if let Some ( ex ) = theme_table . get ( " " ) { if ex . is_table ( ) { extra = ex . clone ( ) . try_into ( ) . unwrap ( ) ; } } } else { bail ! ( " " ) } Ok ( Theme { extra } ) }
Parses a TOML string to our Theme struct
Parses a TOML string to our Theme struct
content
&str
content
&str