Conversation
|
(Just updated because of merge conflicts) |
|
Hmm. I've been mulling this order. I am not a fan of how this not reflect the existing From impl, which is from |
|
Basically it enables some generic code that I'm working on that uses I have a generic interface to build a path structure that parses path segments which can be various types. The (simplified) interface looks like this: impl<Seg> Path<Seg> {
fn from_strs<S: AsRef<str>>(
segs: impl IntoIterator<Item = S>,
) -> Result<Self, <Seg as FromStr>::Err>
where
Seg: FromStr
{
...
}
}Originally I was using I don't think you'd be able to write a version of An alternative would be to re-write the interface to use a custom trait, which is not that big a deal. The situation just highlighted that |
This is intended to be akin to the
FromStrimplementation forStringfound instd::string.