/// Parse scorecard data and structure it
Parse scorecard data and structure it
Parse scorecard data and structure it
fn parse_scorecard(html: &str, scorecard: &mut Vec<MatchInningsInfo>) {
    let doc = Html::parse_document(html);
    for ino in 1..5 {
        // This unwrap will not panic
        let inngs_sel = Selector::parse(format!("div[id=\"innings_{}\"]", ino).as_str()).unwrap();
        if let Some(div) = doc.select(&inngs_sel).next() {
            populate_innings_info(&div, scorecard);
        }
    }
}
fn parse_scorecard ( html : & str , scorecard : & mut Vec < MatchInningsInfo > ) { let doc = Html :: parse_document ( html ) ; for ino in 1 .. 5 { // This unwrap will not panic let inngs_sel = Selector :: parse ( format ! ( " \" \" " ino ) . as_str ( ) ) . unwrap ( ) ; if let Some ( div ) = doc . select ( & inngs_sel ) . next ( ) { populate_innings_info ( & div , scorecard ) ; } } }
Parse scorecard data and structure it
Parse scorecard data and structure it
html
&str
scorecard
&mut Vec<MatchInningsInfo>