From 95c8b8d123c0fbd546b2cd427ae6defb63d6106f Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Sat, 4 Jul 2020 13:10:51 -0400 Subject: [PATCH] remove clone from extend_simple --- src/selector/extend/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/selector/extend/mod.rs b/src/selector/extend/mod.rs index 4d1f1c4..b96d12e 100644 --- a/src/selector/extend/mod.rs +++ b/src/selector/extend/mod.rs @@ -542,12 +542,15 @@ impl Extender { media_query_context: &Option>, targets_used: &mut HashSet, ) -> Option>> { - if let SimpleSelector::Pseudo( - simple @ Pseudo { - selector: Some(..), .. - }, - ) = simple.clone() + if let SimpleSelector::Pseudo(Pseudo { + selector: Some(..), .. + }) = &simple { + let simple = if let SimpleSelector::Pseudo(pseudo) = simple.clone() { + pseudo + } else { + unreachable!() + }; if let Some(extended) = self.extend_pseudo(simple, extensions, media_query_context) { return Some( extended