fn rating_or_version(crate_name: &str, crate_version: &str) -> anyhow::Result<String> {
    let vec = crate::db_sled_mod::db_review_mod::all_versions_for_crate(crate_name)?;
    let mut version = "".to_string();
    for x in vec.iter() {
        if x.crate_version == crate_version {
            return Ok(x.rating.clone());
        }
        version = x.crate_version.clone();
    }
    Ok(version)
}
/// if exists my review for crate version returns the rating
/// if exists any review for this crate returns version number
/// else return empty string
if exists my review for crate version returns the rating
if exists any review for this crate returns version number
else return empty string
if exists my review for crate version returns the rating if exists any review for this crate returns version number else return empty string
fn rating_or_version(crate_name: &str, crate_version: &str) -> anyhow::Result<String> {
    let vec = crate::db_sled_mod::db_review_mod::all_versions_for_crate(crate_name)?;
    let mut version = "".to_string();
    for x in vec.iter() {
        if x.crate_version == crate_version {
            return Ok(x.rating.clone());
        }
        version = x.crate_version.clone();
    }
    Ok(version)
}
fn rating_or_version ( crate_name : & str , crate_version : & str ) -> anyhow :: Result < String > { let vec = crate :: db_sled_mod :: db_review_mod :: all_versions_for_crate ( crate_name ) ? ; let mut version = " " . to_string ( ) ; for x in vec . iter ( ) { if x . crate_version == crate_version { return Ok ( x . rating . clone ( ) ) ; } version = x . crate_version . clone ( ) ; } Ok ( version ) }
if exists my review for crate version returns the rating
if exists any review for this crate returns version number
else return empty string
if exists my review for crate version returns the rating if exists any review for this crate returns version number else return empty string
crate_name
&str
crate_version
&str