mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-13 00:32:25 +01:00
Refactor HighlightingAssets::get_syntax to return Result type
This commit is contained in:
@@ -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