From 444e61f23d72e25ceca4edd2136ba88b215ea228 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 19 Feb 2018 02:55:56 -0800 Subject: [PATCH] Spiffy up 'uncased_eq' implementation. --- lib/src/http/uncased.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/http/uncased.rs b/lib/src/http/uncased.rs index 5cfb76ab..d4edd891 100644 --- a/lib/src/http/uncased.rs +++ b/lib/src/http/uncased.rs @@ -338,9 +338,7 @@ impl<'s> Hash for Uncased<'s> { /// s2.to_lower()`, but does it in a much faster way. #[inline(always)] pub fn uncased_eq, S2: AsRef>(s1: S1, s2: S2) -> bool { - let ascii_ref_1: &UncasedStr = s1.as_ref().into(); - let ascii_ref_2: &UncasedStr = s2.as_ref().into(); - ascii_ref_1 == ascii_ref_2 + UncasedStr::new(s1.as_ref()) == UncasedStr::new(s2.as_ref()) } #[cfg(test)]