We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PartialEq<Builtin> for str/String
We should implement PartialEq<Builtin> for &str and PartialEq<Builtin> for String so that both ident == str and str == ident work.
PartialEq<Builtin> for &str
PartialEq<Builtin> for String
ident == str
str == ident
The text was updated successfully, but these errors were encountered:
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?
PartialEq<Identifier> for str
&ident == str
str == &ident
str
std::string::String
Sorry, something went wrong.
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
PartialEq<&str> for Identifier
Adding PartialEq for String is mainly a convenience. Rust also implements str == String, it would be nice if Identifiers allow String comparison too.
PartialEq
String
str == String
Identifiers
Is str in the example is std::string::String?
It's either a &str or std::string::String`
&str or
Thank you! I got it.
No branches or pull requests
We should implement
PartialEq<Builtin> for &str
andPartialEq<Builtin> for String
so that bothident == str
andstr == ident
work.The text was updated successfully, but these errors were encountered: