≈ the.bay.news

Is there a trait to make `match` work between different types?

The Rust Programming Language Forum
Is there a trait to make `match` work between different types?
I'm trying to write a case-insensitive string type, and I'm having problems with match arms. It seems that match doesn't use PartialEq under the hood, but I couldn't find out if there's another trait that it uses. (Most results for "match" + "trait" are about matching on traits, which is not what I'm interested in here). Here's a minimal example: #[derive(Debug)] pub struct CaseInsensitiveStr<'a>(&'a str); impl<'a> CaseInsensitiveStr<'a> { #[inline] pub const fn new(s: &'a str) -> Cas...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.