pub fn verify_project() -> anyhow::Result<VerifyListData> {
    let output = std::process::Command::new("cargo").arg("crev").arg("verify").output().unwrap();
    let output = format!("{} {}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
    let vec_publisher_item = crate::db_sled_mod::db_publisher_mod::list()?;

    let mut list_of_verify = vec![];
    for line in output.lines() {
        if line.starts_with("none ") || line.starts_with("pass ") || line.starts_with("warn ") {
            let s: Vec<&str> = line.split_whitespace().collect();
            let mut status = s[0].to_string();
            let crate_name = s[1].to_string();
            let crate_version = s[2].to_string();
            let crate_name_version = join_crate_version(&crate_name, &crate_version);

            let published_by_url = published_by_url(&crate_name, &crate_version)?;
            let trusted_publisher = is_trusted_publisher(&vec_publisher_item, &published_by_url);
            if crate::db_sled_mod::db_yanked_mod::exists(&crate_name_version) {
                status = "yanked".to_string();
            }

            let my_review = rating_or_version(&crate_name, &crate_version)?;

            list_of_verify.push(VerifyItemData {
                status,
                my_review,
                crate_name,
                crate_version,
                published_by_url,
                trusted_publisher,
            })
        }
    }
    verify_sort_list_by_name_version(&mut list_of_verify);

    Ok(VerifyListData {
        project_dir: env::current_dir()?.to_string_lossy().to_string(),
        list_of_verify,
    })
}
/// verify_project should return some data quickly, but in the background start to fill the db_version
/// for all these crates. So the next time we have more complete data
verify_project should return some data quickly, but in the background start to fill the db_version
for all these crates. So the next time we have more complete data
verify_project should return some data quickly but in the background start to fill the db_version for all these crates . So the next time we have more complete data
pub fn verify_project() -> anyhow::Result<VerifyListData> {
    let output = std::process::Command::new("cargo").arg("crev").arg("verify").output().unwrap();
    let output = format!("{} {}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
    let vec_publisher_item = crate::db_sled_mod::db_publisher_mod::list()?;
    let mut list_of_verify = vec![];
    for line in output.lines() {
        if line.starts_with("none ") || line.starts_with("pass ") || line.starts_with("warn ") {
            let s: Vec<&str> = line.split_whitespace().collect();
            let mut status = s[0].to_string();
            let crate_name = s[1].to_string();
            let crate_version = s[2].to_string();
            let crate_name_version = join_crate_version(&crate_name, &crate_version);
            let published_by_url = published_by_url(&crate_name, &crate_version)?;
            let trusted_publisher = is_trusted_publisher(&vec_publisher_item, &published_by_url);
            if crate::db_sled_mod::db_yanked_mod::exists(&crate_name_version) {
                status = "yanked".to_string();
            }
            let my_review = rating_or_version(&crate_name, &crate_version)?;
            list_of_verify.push(VerifyItemData {
                status,
                my_review,
                crate_name,
                crate_version,
                published_by_url,
                trusted_publisher,
            })
        }
    }
    verify_sort_list_by_name_version(&mut list_of_verify);
    Ok(VerifyListData {
        project_dir: env::current_dir()?.to_string_lossy().to_string(),
        list_of_verify,
    })
}
pub fn verify_project ( ) -> anyhow :: Result < VerifyListData > { let output = std :: process :: Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . output ( ) . unwrap ( ) ; let output = format ! ( " " String from_utf8_lossy ( output stdout ) String from_utf8_lossy ( output stderr ) ) ; let vec_publisher_item = crate :: db_sled_mod :: db_publisher_mod :: list ( ) ? ; let mut list_of_verify = vec ! [ ] ; for line in output . lines ( ) { if line . starts_with ( " " ) || line . starts_with ( " " ) || line . starts_with ( " " ) { let s : Vec < & str > = line . split_whitespace ( ) . collect ( ) ; let mut status = s [ 0 ] . to_string ( ) ; let crate_name = s [ 1 ] . to_string ( ) ; let crate_version = s [ 2 ] . to_string ( ) ; let crate_name_version = join_crate_version ( & crate_name , & crate_version ) ; let published_by_url = published_by_url ( & crate_name , & crate_version ) ? ; let trusted_publisher = is_trusted_publisher ( & vec_publisher_item , & published_by_url ) ; if crate :: db_sled_mod :: db_yanked_mod :: exists ( & crate_name_version ) { status = " " . to_string ( ) ; } let my_review = rating_or_version ( & crate_name , & crate_version ) ? ; list_of_verify . push ( VerifyItemData { status , my_review , crate_name , crate_version , published_by_url , trusted_publisher , } ) } } verify_sort_list_by_name_version ( & mut list_of_verify ) ; Ok ( VerifyListData { project_dir : env :: current_dir ( ) ? . to_string_lossy ( ) . to_string ( ) , list_of_verify , } ) }
verify_project should return some data quickly, but in the background start to fill the db_version
for all these crates.
verify_project should return some data quickly but in the background start to fill the db_version for all these crates .