From e26cc781a758c8a63387638a3607e5d7537d63ec Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 18 Jan 2025 13:54:25 +0200 Subject: [PATCH] Dereference before calling `partial_cmp` This avoids relying on automatic dereference in the compiler, which can fail if any other trait impls are available. --- flexstr/src/impls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexstr/src/impls.rs b/flexstr/src/impls.rs index 322167f..4a16529 100644 --- a/flexstr/src/impls.rs +++ b/flexstr/src/impls.rs @@ -198,7 +198,7 @@ where { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - str::partial_cmp(self, other) + str::partial_cmp(self, &**other) } }