Handle syntax-set loading errors

This commit is contained in:
sharkdp 2018-05-25 22:12:30 +02:00 committed by David Peter
parent 39e2971e96
commit a348a9f68e
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ impl HighlightingAssets {
syntax_dir.to_string_lossy() syntax_dir.to_string_lossy()
).into()); ).into());
} }
let _ = syntax_set.load_syntaxes(syntax_dir, true); syntax_set.load_syntaxes(syntax_dir, true)?;
syntax_set.load_plain_text_syntax(); syntax_set.load_plain_text_syntax();
Ok(HighlightingAssets { Ok(HighlightingAssets {

View File

@ -40,6 +40,7 @@ mod errors {
foreign_links { foreign_links {
Clap(::clap::Error); Clap(::clap::Error);
Io(::std::io::Error); Io(::std::io::Error);
SyntectError(::syntect::LoadingError);
} }
} }