Skip to content

Commit

Permalink
fix: make rustfmt happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloxaf committed Oct 13, 2022
1 parent 8aa690a commit 6a3f037
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::directories::PROJECT_DIRS;
use anyhow::Result;
use syntect::dumps;
use syntect::highlighting::ThemeSet;
use syntect::parsing::{SyntaxSet};
use syntect::parsing::SyntaxSet;

const DEFAULT_SYNTAXSET: &'static [u8] = include_bytes!("../assets/syntaxes.bin");
const DEFAULT_THEMESET: &'static [u8] = include_bytes!("../assets/themes.bin");
Expand Down Expand Up @@ -32,11 +32,8 @@ impl HighlightingAssets {

pub fn add_from_folder<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
let path = path.as_ref();
self.theme_set
.add_from_folder(path.join("themes"))?;
let mut builder = self.syntax_set
.clone()
.into_builder();
self.theme_set.add_from_folder(path.join("themes"))?;
let mut builder = self.syntax_set.clone().into_builder();
builder.add_from_folder(path.join("syntaxes"), true)?;
self.syntax_set = builder.build();
Ok(())
Expand Down
1 change: 0 additions & 1 deletion src/bin/silicon/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ pub struct Config {
// Draw a custom text on the bottom right corner
// #[structopt(long)]
// watermark: Option<String>,

/// build syntax definition and theme cache
#[structopt(long)]
pub build_cache: Option<PathBuf>,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/silicon/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn run() -> Result<(), Error> {
let mut ha = HighlightingAssets::new();
ha.add_from_folder(path)?;
ha.dump_to_file()?;
return Ok(())
return Ok(());
} else if config.list_themes {
for i in ts.themes.keys() {
println!("{}", i);
Expand Down

0 comments on commit 6a3f037

Please sign in to comment.