Rollup merge of #112538 - ndrewxie:issue-84447-partial-1, r=compiler-errors

Removed unnecessary &String -> &str, now that &String implements StableOrd as well

Applied a few nits suggested by lcnr to PR #110040 (nits can be found [here](https://github.com/rust-lang/rust/pull/110040#pullrequestreview-1469452191).)

Making a new PR because the old one was already merged, and given that this just applies changes that were already suggested, reviewing it should be fairly open-and-shut.
This commit is contained in:
Guillaume Gomez 2023-06-21 20:00:49 +02:00 committed by GitHub
commit a5561eb4d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 16 deletions

View file

@ -107,6 +107,10 @@ impl<T, I: Iterator<Item = T>> UnordItems<T, I> {
{
UnordItems(self.0.flat_map(f))
}
pub fn collect<C: From<UnordItems<T, I>>>(self) -> C {
self.into()
}
}
impl<T> UnordItems<T, std::iter::Empty<T>> {
@ -161,10 +165,6 @@ impl<T: Ord, I: Iterator<Item = T>> UnordItems<T, I> {
items.sort_by_cached_key(|x| x.to_stable_hash_key(hcx));
items
}
pub fn collect<C: From<UnordItems<T, I>>>(self) -> C {
self.into()
}
}
/// This is a set collection type that tries very hard to not expose