highlight: take callback parameters by value

This commit is contained in:
Max Brunsfeld 2019-02-20 10:27:08 -08:00
parent c20a330fa5
commit 2ee5cbbc1d
2 changed files with 9 additions and 9 deletions

View file

@ -195,7 +195,7 @@ pub fn ansi(
let stdout = io::stdout();
let mut stdout = stdout.lock();
let mut scope_stack = Vec::new();
for event in highlight(source, language, property_sheet, &|s| {
for event in highlight(source, language, property_sheet, |s| {
language_for_injection_string(loader, s)
})? {
match event {
@ -258,8 +258,8 @@ pub fn html(
source,
language,
property_sheet,
&|s| language_for_injection_string(loader, s),
&|scope| {
|s| language_for_injection_string(loader, s),
|scope| {
if let Some(css_style) = theme.css_style(scope) {
css_style
} else {