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: union_file.rs
    path of file: ./repos/rusty-gql/cli/src/code_generate/type_definition
    
    the code of the file until where you have to start completion: use std::collections::HashSet;

use codegen::Scope;
use proc_macro2::TokenStream;
use quote::quote;
use rusty_gql::UnionType;
use syn::ext::IdentExt;
use tokio::io::{AsyncReadExt,
    
    pub async fn create_file(&self) -> Result<(), std::io::Error> {
        let path = self.path;
        match tokio::fs::File::open(&path).await {
            Ok(mut file) => {
                let mut current_file_src = String::new();
                file.read_to_string(&mut current_file_src).await?;
                let content = sync_file(&current_file_src, self.def);
                let mut new_file = tokio::fs::File::create(&path).await?;
                new_file.write(content.as_bytes()).await?;
                Ok(())
            }
            Err(_) => {
                let mut file = tokio::fs::File::create(&path).await?;
                file.write(new_file_content(self.def).as_bytes()).await?;
                Ok(())
            }
        }
    }