pub(crate) fn load() -> CrateInfo {
    // load crate info
    let file_path = Path::new("Cargo.toml");

    if file_path.exists() {
        debug!("Opening file: {:#?}", &file_path);
        let mut file = match File::open(&file_path) {
            Ok(value) => value,
            Err(error) => panic!("Unable to open Cargo.toml, error: {}", error),
        };
        let mut crate_info_string = String::new();
        file.read_to_string(&mut crate_info_string).unwrap();

        let mut crate_info: CrateInfo = match toml::from_str(&crate_info_string) {
            Ok(value) => value,
            Err(error) => panic!("Unable to parse Cargo.toml, {}", error),
        };

        load_workspace_members(&mut crate_info);

        debug!("Loaded Cargo.toml: {:#?}", &crate_info);

        crate_info
    } else {
        CrateInfo::new()
    }
}
/// Loads the crate info based on the Cargo.toml found in the current working directory.
Loads the crate info based on the Cargo.toml found in the current working directory.
Loads the crate info based on the Cargo . toml found in the current working directory .
pub(crate) fn load() -> CrateInfo {
    // load crate info
    let file_path = Path::new("Cargo.toml");
    if file_path.exists() {
        debug!("Opening file: {:#?}", &file_path);
        let mut file = match File::open(&file_path) {
            Ok(value) => value,
            Err(error) => panic!("Unable to open Cargo.toml, error: {}", error),
        };
        let mut crate_info_string = String::new();
        file.read_to_string(&mut crate_info_string).unwrap();
        let mut crate_info: CrateInfo = match toml::from_str(&crate_info_string) {
            Ok(value) => value,
            Err(error) => panic!("Unable to parse Cargo.toml, {}", error),
        };
        load_workspace_members(&mut crate_info);
        debug!("Loaded Cargo.toml: {:#?}", &crate_info);
        crate_info
    } else {
        CrateInfo::new()
    }
}
pub ( crate ) fn load ( ) -> CrateInfo { // load crate info let file_path = Path :: new ( " " ) ; if file_path . exists ( ) { debug ! ( " " file_path ) ; let mut file = match File :: open ( & file_path ) { Ok ( value ) => value , Err ( error ) => panic ! ( " " error ) , } ; let mut crate_info_string = String :: new ( ) ; file . read_to_string ( & mut crate_info_string ) . unwrap ( ) ; let mut crate_info : CrateInfo = match toml :: from_str ( & crate_info_string ) { Ok ( value ) => value , Err ( error ) => panic ! ( " " error ) , } ; load_workspace_members ( & mut crate_info ) ; debug ! ( " " crate_info ) ; crate_info } else { CrateInfo :: new ( ) } }
Loads the crate info based on the Cargo.toml found in the current working directory.
Loads the crate info based on the Cargo . toml found in the current working directory .