diff --git a/src/assets.rs b/src/assets.rs index 3c12531683..89392fea6b 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -55,7 +55,7 @@ impl HighlightingAssets { pub fn from_files(source_dir: &Path, include_integrated_assets: bool) -> Result { let mut theme_set = if include_integrated_assets { - Self::get_integrated_themeset() + get_integrated_themeset() } else { ThemeSet { themes: BTreeMap::new(), @@ -84,7 +84,7 @@ impl HighlightingAssets { builder.add_plain_text_syntax(); builder } else { - Self::get_integrated_syntaxset().into_builder() + get_integrated_syntaxset().into_builder() }; let syntax_dir = source_dir.join("syntaxes"); @@ -110,19 +110,8 @@ impl HighlightingAssets { )) } - fn get_integrated_syntaxset() -> SyntaxSet { - from_binary(include_bytes!("../assets/syntaxes.bin")) - } - - fn get_integrated_themeset() -> ThemeSet { - from_binary(include_bytes!("../assets/themes.bin")) - } - pub fn from_binary() -> Self { - HighlightingAssets::new( - Self::get_integrated_syntaxset(), - Self::get_integrated_themeset(), - ) + HighlightingAssets::new(get_integrated_syntaxset(), get_integrated_themeset()) } pub fn save_to_cache(&self, target_dir: &Path, current_version: &str) -> Result<()> { @@ -284,6 +273,14 @@ impl HighlightingAssets { } } +fn get_integrated_syntaxset() -> SyntaxSet { + from_binary(include_bytes!("../assets/syntaxes.bin")) +} + +fn get_integrated_themeset() -> ThemeSet { + from_binary(include_bytes!("../assets/themes.bin")) +} + fn asset_to_cache(asset: &T, path: &Path, description: &str) -> Result<()> { print!("Writing {} to {} ... ", description, path.to_string_lossy()); dump_to_file(asset, &path).chain_err(|| {