pub fn infer_version_change(diff: &str) -> Option<(String, String)> {
    let img_re = Regex::new(r"[^:]+:(?P<version>[a-z0-9\.\-]+)").unwrap();
    let res = img_re
        .captures_iter(diff)
        .map(|cap| cap["version"].to_string())
        .collect::<Vec<String>>();
    if res.len() >= 2 {
        return Some((res[0].clone(), res[1].clone()));
    }
    None
}
/// Infer a version change diff and extract old version and new version
Infer a version change diff and extract old version and new version
Infer a version change diff and extract old version and new version
pub fn infer_version_change(diff: &str) -> Option<(String, String)> {
    let img_re = Regex::new(r"[^:]+:(?P<version>[a-z0-9\.\-]+)").unwrap();
    let res = img_re
        .captures_iter(diff)
        .map(|cap| cap["version"].to_string())
        .collect::<Vec<String>>();
    if res.len() >= 2 {
        return Some((res[0].clone(), res[1].clone()));
    }
    None
}
pub fn infer_version_change ( diff : & str ) -> Option < ( String , String ) > { let img_re = Regex :: new ( r"[^:]+:(?P<version>[a-z0-9\.\-]+)" ) . unwrap ( ) ; let res = img_re . captures_iter ( diff ) . map ( | cap | cap [ " " ] . to_string ( ) ) . collect :: < Vec < String > > ( ) ; if res . len ( ) >= 2 { return Some ( ( res [ 0 ] . clone ( ) , res [ 1 ] . clone ( ) ) ) ; } None }
Infer a version change diff and extract old version and new version
Infer a version change diff and extract old version and new version
diff
&str
diff
&str