From bbe7ff86da84f3ddff69e965cb2be2afa0fad5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 18 Jan 2018 23:50:03 +0100 Subject: [PATCH] selectors: Simplify SelectorIter::next. --- components/selectors/parser.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 465e6acaa8c..91981562366 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -609,13 +609,12 @@ impl<'a, Impl: SelectorImpl> Iterator for SelectorIter<'a, Impl> { fn next(&mut self) -> Option { debug_assert!(self.next_combinator.is_none(), "You should call next_sequence!"); - match self.iter.next() { - None => None, - Some(&Component::Combinator(c)) => { + match *self.iter.next()? { + Component::Combinator(c) => { self.next_combinator = Some(c); None }, - Some(x) => Some(x), + ref x => Some(x), } } }