summaryrefslogtreecommitdiffstats
path: root/vendor/im-rc/src/tests/mod.rs
blob: cafea5f9fe6419e5d68b62b52a652b28dc5dffd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod hashset;
mod ordset;
mod vector;

fn code_fmt(code: &str) -> String {
    // use syntect::easy::HighlightLines;
    // use syntect::highlighting::{Style, ThemeSet};
    // use syntect::parsing::SyntaxSet;
    // use syntect::util::{as_24_bit_terminal_escaped, LinesWithEndings};
    //
    // let ps = SyntaxSet::load_defaults_newlines();
    // let ts = ThemeSet::load_defaults();
    // let syntax = ps.find_syntax_by_extension("rs").unwrap();
    // let mut h = HighlightLines::new(syntax, &ts.themes["base16-ocean.dark"]);
    // let mut out = String::from("\n\n");
    // for line in LinesWithEndings::from(&code) {
    //     let ranges: Vec<(Style, &str)> = h.highlight(line, &ps);
    //     let escaped = as_24_bit_terminal_escaped(&ranges[..], false);
    //     out += &escaped;
    // }
    // out += "\n\x1b[0m";
    // out
    code.to_string()
}