You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@brokenthorn I agree. I think it makes it much clearer as to what's going on, however it's more idiomatic again to implement TryFrom<&str> for Selector. The From (and implied Into) traits are meant for conversions that won't fail. Using their Try* equivalents returns a Result which makes more sense. By implementing TryFrom we get TryInto for free also.
Note, that it would be awesome to do something even more generic like this: impl<'i, T: Deref<Target = str>> TryFrom<&'i T> for Selector so that we get deref coercion automatically but at the moment that will cause a conflict with the blanket implementation in core (see rust-lang/rust#50133 (comment)).
The intermediate parsing of the
Selector
itself is a bit annoying. I think it would be neat if it were part of theselect()
.Current:
Proposed a):
Proposed b):
The text was updated successfully, but these errors were encountered: