pub fn restore_orignal_cargo_files(project_dir: &PathBuf) -> Result<()> {
    let paths = CargoPaths::new(project_dir);

    copy(&paths.toml_backup, &paths.cargo_toml).with_context(|| {
        format!(
            "Could not restore backup from {:?} to {:?}",
            &paths.toml_backup, &paths.cargo_toml
        )
    })?;

    if paths.cargo_lock.exists() && paths.lock_backup.exists() {
        copy(&paths.lock_backup, &paths.cargo_lock).with_context(|| {
            format!(
                "Could not restore backup from {:?} to {:?}",
                &paths.lock_backup, &paths.cargo_lock
            )
        })?;
    }

    Ok(())
}
/// Restores copies of the original Cargo.toml and Cargo.lock files in the project directory.
///
/// * `project_dir` - The path to the RTIC project
Restores copies of the original Cargo.toml and Cargo.lock files in the project directory.
`project_dir` - The path to the RTIC project
Restores copies of the original Cargo . toml and Cargo . lock files in the project directory . ` project_dir ` - The path to the RTIC project
pub fn restore_orignal_cargo_files(project_dir: &PathBuf) -> Result<()> {
    let paths = CargoPaths::new(project_dir);
    copy(&paths.toml_backup, &paths.cargo_toml).with_context(|| {
        format!(
            "Could not restore backup from {:?} to {:?}",
            &paths.toml_backup, &paths.cargo_toml
        )
    })?;
    if paths.cargo_lock.exists() && paths.lock_backup.exists() {
        copy(&paths.lock_backup, &paths.cargo_lock).with_context(|| {
            format!(
                "Could not restore backup from {:?} to {:?}",
                &paths.lock_backup, &paths.cargo_lock
            )
        })?;
    }
    Ok(())
}
pub fn restore_orignal_cargo_files ( project_dir : & PathBuf ) -> Result < ( ) > { let paths = CargoPaths :: new ( project_dir ) ; copy ( & paths . toml_backup , & paths . cargo_toml ) . with_context ( | | { format ! ( " " paths toml_backup paths cargo_toml ) } ) ? ; if paths . cargo_lock . exists ( ) && paths . lock_backup . exists ( ) { copy ( & paths . lock_backup , & paths . cargo_lock ) . with_context ( | | { format ! ( " " paths lock_backup paths cargo_lock ) } ) ? ; } Ok ( ( ) ) }
Restores copies of the original Cargo.toml and Cargo.lock files in the project directory.
Restores copies of the original Cargo . toml and Cargo . lock files in the project directory .
project_dir
&PathBuf
project_dir
&PathBuf