From 040fff92c1ca910ff558c593aa3c8e9e11b8ddbe Mon Sep 17 00:00:00 2001 From: InioX Date: Thu, 14 Dec 2023 20:31:03 +0100 Subject: [PATCH] fix: remove compilation errors on unix --- src/main.rs | 4 ++-- src/util/color.rs | 2 +- src/util/template.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index e2ed5d8..5613efa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,12 +84,12 @@ fn main() -> Result<(), Report> { show_color(&schemes, &source_color); } - if let Some(format) = args.json { + if let Some(ref format) = args.json { dump_json(&schemes, &source_color, format); } if args.dry_run == Some(false) { - Template::generate(&schemes, &config.templates, &args.source, &config.config.prefix, &source_color, &default_scheme, config.config.custom_keywords)?; + Template::generate(&schemes, &config.templates, &args.source, &config.config.prefix, &source_color, &default_scheme, &config.config.custom_keywords)?; if config.config.reload_apps == Some(true) { #[cfg(any(target_os = "linux", target_os = "netbsd"))] diff --git a/src/util/color.rs b/src/util/color.rs index 89ebfb7..74fce8f 100644 --- a/src/util/color.rs +++ b/src/util/color.rs @@ -261,7 +261,7 @@ fn hex(color: Color, prefix: bool) -> String { ) } -pub fn dump_json(schemes: &Schemes, source_color: &[u8; 4], format: Format) { +pub fn dump_json(schemes: &Schemes, source_color: &[u8; 4], format: &Format) { type F = Format; let fmt = match format { F::Rgb => |c: Color| format!("rgb({:?}, {:?}, {:?})", c.red, c.green, c.blue), diff --git a/src/util/template.rs b/src/util/template.rs index db02c67..2b33fe2 100644 --- a/src/util/template.rs +++ b/src/util/template.rs @@ -146,7 +146,7 @@ impl Template { prefix: &Option, source_color: &[u8; 4], default_scheme: &SchemesEnum, - custom_keywords: Option>, + custom_keywords: &Option>, ) -> Result<(), Report> { let default_prefix = "@".to_string();