|
|
|
|
|
by JoshTriplett
3399 days ago
|
|
> String and &str can normally be compared because of Deref, that is, &String derefs to &str. Option, on the other hand, does not implement Deref, and so no coercion happens. For this particular case, any particular reason we couldn't add an impl of PartialEq? In fact, once we have specialization, couldn't we have a general impl of PartialEq for Options of Deref types? |
|
> couldn't we have a general impl of PartialEq for Options of Deref types?
I think the issue is None. You'd get a null pointer, which doesn't make any sense in safe rust.