From 0d8dc656f18a64b603781674c4bec7f19e052667 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Mon, 19 Mar 2018 10:04:48 -0600 Subject: [PATCH] CR review: s/Options/SassOptions/, break bail args in compile_sass into multiple lines --- components/site/src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 01fd050..b16a381 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -28,7 +28,7 @@ use std::path::{Path, PathBuf}; use glob::glob; use tera::{Tera, Context}; use walkdir::WalkDir; -use sass_rs::{Options, OutputStyle, compile_file}; +use sass_rs::{Options as SassOptions, OutputStyle, compile_file}; use errors::{Result, ResultExt}; use config::{Config, get_config}; @@ -537,7 +537,7 @@ impl Site { sass_path }; - let mut options = Options::default(); + let mut options = SassOptions::default(); options.output_style = OutputStyle::Compressed; let mut compiled_paths = self.compile_sass_glob(&sass_path, "scss", options.clone())?; @@ -547,14 +547,19 @@ impl Site { compiled_paths.sort(); for window in compiled_paths.windows(2) { if window[0].1 == window[1].1 { - bail!("SASS path conflict: \"{}\" and \"{}\" both compile to \"{}\"", window[0].0.display(), window[1].0.display(), window[0].1.display()); + bail!( + "SASS path conflict: \"{}\" and \"{}\" both compile to \"{}\"", + window[0].0.display(), + window[1].0.display(), + window[0].1.display(), + ); } } Ok(()) } - fn compile_sass_glob(&self, sass_path: &Path, extension: &str, options: Options) -> Result> { + fn compile_sass_glob(&self, sass_path: &Path, extension: &str, options: SassOptions) -> Result> { let glob_string = format!("{}/**/*.{}", sass_path.display(), extension); let files = glob(&glob_string) .unwrap()