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: html.rs
    path of file: ./repos/tarpaulin/src/report
    
    the code of the file until where you have to start completion: use crate::config::Config;
use crate::errors::*;
use crate::report::{get_previous_result, safe_json};
use crate::traces::{Trace, TraceMap};
use serde::Serialize;
use std::fs::{read_to_string, File};
use std::io::{self, Write};

#[derive(Serialize)]
struct SourceFile {
    pub path: Vec<String>,
    pub content: String,
    pub traces: Vec<Trace>,
    pub covered: usize,
    pub coverable: usize,
}

#[derive(Serialize)]
struct CoverageReport {
    pub files: Vec<SourceFile>,
}

#[derive(PartialEq)]
enum Context {
    CurrentResults,
    PreviousResults,
}

fn get_json(coverage_data: &TraceMap, context: Context) -> Result<String, RunError> {
    let mut report = CoverageReport { files: Vec::new() };

    for (path, traces) in coverage_data.iter() {
        let 
    
fn get_json(coverage_data: &TraceMap, context: Context) -> Result<String, RunError> {
    let mut report = CoverageReport { files: Vec::new() };

    for (path, traces) in coverage_data.iter() {
        let content = match read_to_string(path) {
            Ok(k) => k,
            Err(e) => {
                if context == Context::PreviousResults && e.kind() == io::ErrorKind::NotFound {
                    // Assume the file has been deleted since the last run.
                    continue;
                }

                return Err(RunError::Html(format!(
                    "Unable to read source file to string: {e}"
                )));
            }
        };

        report.files.push(SourceFile {
            path: path
                .components()
                .map(|c| c.as_os_str().to_string_lossy().to_string())
                .collect(),
            content,
            traces: traces.clone(),
            covered: coverage_data.covered_in_path(path),
            coverable: coverage_data.coverable_in_path(path),
        });
    }

    safe_json::to_string_safe(&report)
        .map_err(|e| RunError::Html(format!("Report isn't serializable: {e}")))
}