mirror of https://github.com/Aloxaf/silicon
fix: make rustfmt happy
This commit is contained in:
parent
8aa690ab25
commit
6a3f037ae2
|
@ -4,7 +4,7 @@ use crate::directories::PROJECT_DIRS;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use syntect::dumps;
|
use syntect::dumps;
|
||||||
use syntect::highlighting::ThemeSet;
|
use syntect::highlighting::ThemeSet;
|
||||||
use syntect::parsing::{SyntaxSet};
|
use syntect::parsing::SyntaxSet;
|
||||||
|
|
||||||
const DEFAULT_SYNTAXSET: &'static [u8] = include_bytes!("../assets/syntaxes.bin");
|
const DEFAULT_SYNTAXSET: &'static [u8] = include_bytes!("../assets/syntaxes.bin");
|
||||||
const DEFAULT_THEMESET: &'static [u8] = include_bytes!("../assets/themes.bin");
|
const DEFAULT_THEMESET: &'static [u8] = include_bytes!("../assets/themes.bin");
|
||||||
|
@ -32,11 +32,8 @@ impl HighlightingAssets {
|
||||||
|
|
||||||
pub fn add_from_folder<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
|
pub fn add_from_folder<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
|
||||||
let path = path.as_ref();
|
let path = path.as_ref();
|
||||||
self.theme_set
|
self.theme_set.add_from_folder(path.join("themes"))?;
|
||||||
.add_from_folder(path.join("themes"))?;
|
let mut builder = self.syntax_set.clone().into_builder();
|
||||||
let mut builder = self.syntax_set
|
|
||||||
.clone()
|
|
||||||
.into_builder();
|
|
||||||
builder.add_from_folder(path.join("syntaxes"), true)?;
|
builder.add_from_folder(path.join("syntaxes"), true)?;
|
||||||
self.syntax_set = builder.build();
|
self.syntax_set = builder.build();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -201,7 +201,6 @@ pub struct Config {
|
||||||
// Draw a custom text on the bottom right corner
|
// Draw a custom text on the bottom right corner
|
||||||
// #[structopt(long)]
|
// #[structopt(long)]
|
||||||
// watermark: Option<String>,
|
// watermark: Option<String>,
|
||||||
|
|
||||||
/// build syntax definition and theme cache
|
/// build syntax definition and theme cache
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pub build_cache: Option<PathBuf>,
|
pub build_cache: Option<PathBuf>,
|
||||||
|
|
|
@ -88,7 +88,7 @@ fn run() -> Result<(), Error> {
|
||||||
let mut ha = HighlightingAssets::new();
|
let mut ha = HighlightingAssets::new();
|
||||||
ha.add_from_folder(path)?;
|
ha.add_from_folder(path)?;
|
||||||
ha.dump_to_file()?;
|
ha.dump_to_file()?;
|
||||||
return Ok(())
|
return Ok(());
|
||||||
} else if config.list_themes {
|
} else if config.list_themes {
|
||||||
for i in ts.themes.keys() {
|
for i in ts.themes.keys() {
|
||||||
println!("{}", i);
|
println!("{}", i);
|
||||||
|
|
Loading…
Reference in New Issue