mirror of
https://github.com/sharkdp/bat
synced 2026-08-07 19:31:42 +00:00
Refactor HighlightingAssets::get_syntax to return Result type
This commit is contained in:
+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