From e5e3943e5cb6dc05aca2bed7f0dda406e9827539 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Wed, 24 Jun 2020 07:05:14 -0400 Subject: [PATCH] allow clippy::single_match --- src/lib.rs | 1 + src/selector/extend/mod.rs | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index be2719f..fabe05b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,7 @@ grass input.scss renamed_and_removed_lints, clippy::unknown_clippy_lints, clippy::replace_consts, + clippy::single_match, // temporarily allowed while under heavy development. // eventually these allows should be refactored away diff --git a/src/selector/extend/mod.rs b/src/selector/extend/mod.rs index 9ebd811..d21cca4 100644 --- a/src/selector/extend/mod.rs +++ b/src/selector/extend/mod.rs @@ -376,31 +376,32 @@ impl Extender { for i in 0..compound.components.len() { let simple = compound.components.get(i).cloned().unwrap(); - if let Some(extended) = self.extend_simple( + match self.extend_simple( simple.clone(), extensions, media_query_context, &mut targets_used, ) { - if options.is_none() { - let mut new_options = Vec::new(); - if i != 0 { - new_options.push(vec![self.extension_for_compound( - compound.components.clone().into_iter().take(i).collect(), - )]); + Some(extended) => { + if options.is_none() { + let mut new_options = Vec::new(); + if i != 0 { + new_options.push(vec![self.extension_for_compound( + compound.components.clone().into_iter().take(i).collect(), + )]); + } + options.replace(new_options); } - options.replace(new_options); - } - match options.as_mut() { - Some(v) => v.extend(extended.into_iter()), - None => unreachable!(), + match options.as_mut() { + Some(v) => v.extend(extended.into_iter()), + None => unreachable!(), + } } - } else { - match options.as_mut() { + None => match options.as_mut() { Some(v) => v.push(vec![self.extension_for_simple(simple)]), None => {} - } + }, } }