You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: install_handler.rs
    path of file: ./repos/bob/src/handlers
    
    the code of the file until where you have to start completion: use crate::config::Config;
use crate::github_requests::{get_commits_for_nightly, get_upstream_nightly, UpstreamVersion};
use crate::helpers::directories::get_downloads_directory;
use crate::helpers::version::nightly::produce_nightly_vec;
use crate::helpers::version::types::{LocalVersion, ParsedVersion, VersionType};
use crate::helpers::{self, directories, filesystem, handle_subprocess, unarchive};
use anyhow::{anyhow, Result};
use futures_util::stream::StreamExt;
use indicatif::{ProgressBar, ProgressStyle};
use reqwest::Client;
use std::cmp::min;
use std::env;
use std::path::Path;
use std::proc
    
async fn handle_rollback(config: &Config) -> Result<()> {
    if !helpers::version::is_version_used("nightly", config).await {
        return Ok(());
    }

    let rollback_limit = config.rollback_limit.unwrap_or(3);

    if rollback_limit == 0 {
        return Ok(());
    }

    let mut nightly_vec = produce_nightly_vec(config).await?;

    if nightly_vec.len() >= rollback_limit.into() {
        let oldest_path = nightly_vec.pop().unwrap().path;
        fs::remove_dir_all(oldest_path).await?;
    }

    // handle this for older installations of nightly instead of introducing breaking changes
    cfg_if::cfg_if! {
        if #[cfg(unix)] {
            use std::os::unix::prelude::PermissionsExt;

            let platform = helpers::get_platform_name();
            let file = &format!("nightly/{platform}/bin/nvim");
            let mut perms = fs::metadata(file).await?.permissions();
            let octal_perms = format!("{:o}", perms.mode());

            if octal_perms == "100111" {
            perms.set_mode(0o551);
            fs::set_permissions(file, perms).await?;
            }

        }
    }

    let nightly_file = fs::read_to_string("nightly/bob.json").await?;
    let mut json_struct: UpstreamVersion = serde_json::from_str(&nightly_file)?;
    let id: String = json_struct
        .target_commitish
        .as_ref()
        .unwrap()
        .chars()
        .take(7)
        .collect();

    info!("Creating rollback: nightly-{id}");
    filesystem::copy_dir("nightly", format!("nightly-{id}")).await?;

    json_struct.tag_name += &format!("-{id}");

    let json_file = serde_json::to_string(&json_struct)?;
    fs::write(format!("nightly-{id}/bob.json"), json_file).await?;

    Ok(())
}