Open MichaReiser opened 1 year ago
Isn't PartialEq<Identifier> for str
enough?
That looks &ident == str
and str == &ident
will work.
Is str
in the example is std::string::String
?
Isn't PartialEq
for str enough?
I don't think it is. Implementing PartialEq<&str> for Identifier
only gives you ident == str
but not str == ident
doc
Adding
PartialEq
forString
is mainly a convenience. Rust also implementsstr == String
, it would be nice ifIdentifiers
allowString
comparison too.Is str in the example is std::string::String?
It's either a &str or
std::string::String`
Thank you! I got it.
We should implement
PartialEq<Builtin> for &str
andPartialEq<Builtin> for String
so that bothident == str
andstr == ident
work.