From 84f05f209c61f7c433dd29912dd845c80aef0ed3 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 4 Apr 2020 11:37:46 -0500 Subject: [PATCH] expand: refactor/polish ~ simplify if condition --- src/tr/expand.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/tr/expand.rs b/src/tr/expand.rs index fa24194ef..a10fb43c8 100644 --- a/src/tr/expand.rs +++ b/src/tr/expand.rs @@ -88,12 +88,7 @@ impl<'a> Iterator for ExpandSet<'a> { if let Some(first) = self.unesc.next() { // peek ahead - if self.unesc.peek() == Some(&'-') - && match self.unesc.size_hint() { - (x, _) if x > 1 => true, // there's a range here; record it in our internal Range struct - _ => false, - } - { + if self.unesc.peek() == Some(&'-') && self.unesc.size_hint().0 > 1 { self.unesc.next(); // this is the '-' let last = self.unesc.next().unwrap(); // this is the end of the range