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: test_json.rs
    path of file: ./repos/miette/tests
    
    the code of the file until where you have to start completion: mod json_report_handler {
    use miette::{Diagnostic, MietteError, NamedSource, Report, SourceSpan};

    use miette::JSONReportHandler;

    use thiserror::Error;

    fn fmt_report(diag: Report) -> String {
        let mut out = String::new();
        JSONReportHandler::new()
            .render_report(&mut out, diag.as_ref())
            .unwrap();
        out
    }

    #[test]
    fn single_line_with_wide_char() -> Result<(), MietteError> {
        #[derive(Debug, Diagnostic, Error)]
        #[error("oops!")]
        #[diagnostic(code(oops::my::bad), help("try doing it better next time?"))]
        struct MyBad {
            #[source_code]
            src: NamedSource<String>,
            #[label("this bit here")]
            highlight: SourceSpan,
        }

        let src = "source\n  ðŸ‘¼ðŸ¼text\n    here".to_string();
        let err = MyBad {
            src: NamedSource::new("bad_file.rs", src),
            highlight: (9, 6).into(
    
    fn single_line_highlight_with_empty_span() -> Result<(), MietteError> {
        #[derive(Debug, Diagnostic, Error)]
        #[error("oops!")]
        #[diagnostic(code(oops::my::bad), help("try doing it better next time?"))]
        struct MyBad {
            #[source_code]
            src: NamedSource<String>,
            #[label("this bit here")]
            highlight: SourceSpan,
        }

        let src = "source\n  text\n    here".to_string();
        let err = MyBad {
            src: NamedSource::new("bad_file.rs", src),
            highlight: (9, 0).into(),
        };
        let out = fmt_report(err.into());
        println!("Error: {}", out);
        let expected: String = r#"
        {
            "message": "oops!",
            "code": "oops::my::bad",
            "severity": "error",
            "causes": [],
            "help": "try doing it better next time?",
            "filename": "bad_file.rs",
            "labels": [
                {
                    "label": "this bit here",
                    "span": {
                        "offset": 9,
                        "length": 0
                    }
                }
            ],
            "related": []
        }"#
        .lines()
        .map(|s| s.trim_matches(|c| c == ' ' || c == '\n'))
        .collect();
        assert_eq!(expected, out);
        Ok(())
    }