fn parse_string(s: &str) -> Option<pest::iterators::Pair<Rule>> {
    let parse_result = GrammarParser::parse(Rule::formula, s);
    //println!("{:#?}", parse_result);
    match parse_result {
        Ok(mut result) => {
            let parse_result = result.next().unwrap();
            Some(parse_result)
        }
        Err(_) => None,
    }
    // GrammarParser::parse(Rule::formula, s)
    //     .expect("unsuccessful parse")
    //     .next()
}
/// Use this function to catch a parse error.
Use this function to catch a parse error.
Use this function to catch a parse error .
fn parse_string(s: &str) -> Option<pest::iterators::Pair<Rule>> {
    let parse_result = GrammarParser::parse(Rule::formula, s);
    //println!("{:#?}", parse_result);
    match parse_result {
        Ok(mut result) => {
            let parse_result = result.next().unwrap();
            Some(parse_result)
        }
        Err(_) => None,
    }
    // GrammarParser::parse(Rule::formula, s)
    //     .expect("unsuccessful parse")
    //     .next()
}
fn parse_string ( s : & str ) -> Option < pest :: iterators :: Pair < Rule > > { let parse_result = GrammarParser :: parse ( Rule :: formula , s ) ; //println!("{:#?}", parse_result); match parse_result { Ok ( mut result ) => { let parse_result = result . next ( ) . unwrap ( ) ; Some ( parse_result ) } Err ( _ ) => None , } // GrammarParser::parse(Rule::formula, s) //     .expect("unsuccessful parse") //     .next() }
Use this function to catch a parse error.
Use this function to catch a parse error .
s
&str