Run cargo fmt

This commit is contained in:
Jordan Johnson-Doyle
2019-02-15 22:01:22 +00:00
parent b32010f905
commit 09e411739a
4 changed files with 61 additions and 34 deletions

View File

@@ -1,9 +1,9 @@
extern crate syntect;
use syntect::parsing::SyntaxSet;
use syntect::highlighting::ThemeSet;
use syntect::easy::HighlightLines;
use syntect::highlighting::ThemeSet;
use syntect::html::{styled_line_to_highlighted_html, IncludeBackground};
use syntect::parsing::SyntaxSet;
/// Takes the content of a paste and the extension passed in by the viewer and will return the content
/// highlighted in the appropriate format in HTML.
@@ -19,5 +19,8 @@ pub fn highlight(content: &str, ext: &str) -> Option<String> {
let mut h = HighlightLines::new(syntax, &TS.themes["base16-ocean.dark"]);
let regions = h.highlight(content, &SS);
Some(styled_line_to_highlighted_html(&regions[..], IncludeBackground::No))
}
Some(styled_line_to_highlighted_html(
&regions[..],
IncludeBackground::No,
))
}