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: base16.rs
    path of file: ./repos/wezterm/sync-color-schemes/src
    
    the code of the file until where you have to start completion: use super::*;
use serde::Deserialize;
use std::sync::Arc;
use tar::Archive;
use tempfile::NamedTempFile;
use tokio::sync::Semaphore;

async fn fetch_base16_list() -> anyhow::Result<Vec<String>> {
    let data = fetch_url_as_str(
        "https://raw.githubusercontent.com/chriskempson/base16-schemes-source/main/list.yaml",
    )
    .await?;

    let mut result = vec![];
    for doc in yaml_rust::YamlLoader::load_from_str(&data)? {
        for value in doc
            .into_hash()
            .ok_or_else(|| anyhow::anyhow!("list.yaml isn't a hash"))?
            .values()
        {
            result.push(
                value
                    .clone()
                    .into_string()
                    .ok_or_else(|| anyhow::anyhow!("item {value:?} is not a string"))?,
            );
        }
    }

    Ok(result)
}

async fn fetch_repo_tarball(repo_url: &str, branch: &str) -> anyhow::Result<Vec<u8>> {
    let tarball_url = format!("{repo_url}
    
pub async fn sync() -> anyhow::Result<Vec<Scheme>> {
    let repos = fetch_base16_list().await?;
    let mut futures = vec![];
    let semaphore = Arc::new(Semaphore::new(10));
    for repo in repos {
        let repo = repo.clone();
        let permit = semaphore.clone().acquire_owned().await.unwrap();
        futures.push(tokio::spawn(async move {
            let topic = CACHE
                .topic("default-branch")
                .context("creating main branch topic")?;

            if let Ok(Some(hit)) = topic.get(&repo) {
                let branch = String::from_utf8_lossy(&hit.data).to_string();
                let tb = fetch_repo_tarball(&repo, &branch).await?;
                return extract_scheme_yamls(&repo, &tb).await;
            }

            for branch in ["main", "master"] {
                if let Ok(tb) = fetch_repo_tarball(&repo, branch).await {
                    topic.set(&repo, branch.as_bytes(), Duration::from_secs(86400))?;
                    return extract_scheme_yamls(&repo, &tb).await;
                }
            }
            drop(permit);
            anyhow::bail!("couldn't figure out branch for {repo}");
        }));
    }

    let mut schemes = vec![];
    for item in futures::future::join_all(futures).await {
        if let Ok(Ok(mut items)) = item {
            schemes.append(&mut items);
        }
    }

    Ok(schemes)
}