3use syntect::parsing::SyntaxSet;
7/// A SyntaxSet in serialized form, i.e. bincoded and flate2 compressed.
8/// We keep it in this format since we want to load it lazily.
10pub enum SerializedSyntaxSet {
11 /// The data comes from a user-generated cache file.
14 /// The data to use is embedded into the bat binary.
15 FromBinary(&'static [u8]),
18impl SerializedSyntaxSet {
19 pub fn deserialize(&self) -> Result<SyntaxSet> {
21 SerializedSyntaxSet::FromBinary(data) => Ok(from_binary(data, COMPRESS_SYNTAXES)),
22 SerializedSyntaxSet::FromFile(ref path) => {
23 asset_from_cache(path, "syntax set", COMPRESS_SYNTAXES)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list