mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
HighlightingAssets: Make .syntaxes() and syntax_for_file_name() failable
Or rather, introduce new versions of these methods and deprecate the old ones. This is preparation to enable robust and user-friendly support for lazy-loading. With lazy-loading, we don't know if the SyntaxSet is valid until after we try to use it, so wherever we try to use it, we need to return a Result. See discussion about panics in #1747.
This commit is contained in:
1 parent
c0e09662b4
commit
a81009607a
6 files changed
+95
-39
No files matched your search
@@ -20,6 +20,7 @@
|
||||
|
||||
## `bat` as a library
|
||||
|
||||
- Deprecate `HighlightingAssets::syntaxes()` and `HighlightingAssets::syntax_for_file_name()`. Use `HighlightingAssets::get_syntaxes()` and `HighlightingAssets::get_syntax_for_file_name()` instead. They return a `Result` which is needed for upcoming lazy-loading work to improve startup performance. See #1747 and #1755 (@Enselic)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user