From 68db304a2aa7f53db4f5faa050e3702b2684d719 Mon Sep 17 00:00:00 2001 From: Kamal Ahmad Date: Tue, 24 Sep 2019 20:33:50 +0500 Subject: [PATCH] Don't apply alpha optimizations unless --alpha is paseed (#187) Closes #164 --- src/lib.rs | 9 ++------- src/main.rs | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f4179808..4b0ccd8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -250,11 +250,6 @@ impl Options { } fn apply_preset_4(mut self) -> Self { - self.alphas.insert(AlphaOptim::White); - self.alphas.insert(AlphaOptim::Up); - self.alphas.insert(AlphaOptim::Down); - self.alphas.insert(AlphaOptim::Left); - self.alphas.insert(AlphaOptim::Right); self.apply_preset_3() } @@ -285,9 +280,9 @@ impl Default for Options { for i in 0..4 { strategies.insert(i); } + // We always need NoOp to be present let mut alphas = HashSet::new(); - alphas.insert(colors::AlphaOptim::NoOp); - alphas.insert(colors::AlphaOptim::Black); + alphas.insert(AlphaOptim::NoOp); Options { backup: false, diff --git a/src/main.rs b/src/main.rs index a83ea18c..e7f37171 100644 --- a/src/main.rs +++ b/src/main.rs @@ -363,6 +363,7 @@ fn parse_opts_into_struct( }; if matches.is_present("alpha") { + opts.alphas.insert(AlphaOptim::Black); opts.alphas.insert(AlphaOptim::White); opts.alphas.insert(AlphaOptim::Up); opts.alphas.insert(AlphaOptim::Down);