mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
Refactor HighlightingAssets::get_syntax to return Result type
This commit is contained in:
1 parent
9c371ed8a2
commit
5aa20c090b
3 files changed
+54
-28
No files matched your search
+4
-1
@@ -164,7 +164,10 @@ impl<'a> InteractivePrinter<'a> {
|
||||
None
|
||||
} else {
|
||||
// Determine the type of syntax for highlighting
|
||||
let syntax = assets.get_syntax(config.language, input, &config.syntax_mapping);
|
||||
let syntax = assets
|
||||
.get_syntax(config.language, input, &config.syntax_mapping)
|
||||
.unwrap_or_else(|_| assets.syntax_set.find_syntax_plain_text());
|
||||
|
||||
Some(HighlightLines::new(syntax, theme))
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user