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: themes.rs
    path of file: ./repos/MarkFlowy/apps/desktop/src-tauri/src/app
    
    the code of the file until where you have to start completion: use super::conf;
use crate::fc::exists;
use serde::{Deserialize, Serialize};
use std::{fs::create_dir, path::PathBuf, vec};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Theme {
    pub id: String,
    pub path: String,
    // package.json content
    pub pkg: String,
    pub script_text: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct AppThemes {
    themes: Vec<Theme>,
}
pub const APP_THEMES_PATH: &str = "themes";

fn build_theme(path: PathBuf) -> Option<Theme> {
    println!("build_themes: {:?}", path);
    let pkg_path = path.join("package.json");
    let script_file_path = path.join("index.js");

    if exists(&pkg_path) {
        let pkg = std::fs::read_to_string(pkg_path)
    
fn build_theme(path: PathBuf) -> Option<Theme> {
    println!("build_themes: {:?}", path);
    let pkg_path = path.join("package.json");
    let script_file_path = path.join("index.js");

    if exists(&pkg_path) {
        let pkg = std::fs::read_to_string(pkg_path).unwrap();
        let pkg: serde_json::Value = serde_json::from_str(&pkg).unwrap();
        let pkg = pkg.to_string();

        let script_text = if exists(&script_file_path) {
            Some(std::fs::read_to_string(script_file_path).unwrap())
        } else {
            None
        };

        return Some(Theme {
            id: path.file_name().unwrap().to_str().unwrap().to_string(),
            path: path.to_str().unwrap().to_string(),
            pkg,
            script_text,
        });
    }

    None
}