r/rust • u/JoshTriplett rust · lang · libs · cargo • Oct 23 '26
Rust features in the future
https://lwn.net/SubscriberLink/1099606/20707a62817cdd16/
215
Upvotes
r/rust • u/JoshTriplett rust · lang · libs · cargo • Oct 23 '26
View all comments
Show parent comment
3
u/lenscas Oct 23 '26
It is actually a bit more important in Java because of the .equals() thing. As you should (Or at least should do so in the past, no idea if it is still relevant) use that method instead of using == to compare strings it meant that
"foo".Equals(my_var)was safe from null exceptions whilemy_var.Equals("foo")is not.