From 1ade79723ba102a05f66e10755dae9bc85fce461 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 2 Jan 2025 21:12:28 +0200 Subject: [PATCH] impl: fix `impl_partial_eq_cow` to apply `.as_bytes()` and `&**` to the correct arguments `impl_partial_eq_cow`, in its second trail impl, had the arguments the wrong way around, applying `&**` to the ByteStr argument and `.as_bytes()` to the `Cow`. Fix it to use the same structure as `impl_partial_eq`. PR #203 --- src/impls.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/impls.rs b/src/impls.rs index fade074..f09bb9e 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -52,8 +52,8 @@ macro_rules! impl_partial_eq_cow { impl<'a> PartialEq<$lhs> for $rhs { #[inline] fn eq(&self, other: &$lhs) -> bool { - let this: &[u8] = (&**other).as_ref(); - PartialEq::eq(this, self.as_bytes()) + let this: &[u8] = (&**self).as_ref(); + PartialEq::eq(this, other.as_bytes()) } } };