3 ms·
TrustedLen will mean it can safely take the upper bound, but Vec for example will still use the lower bound of the hint when something isn't TrustedLen https:/
by Alexendoo 4y ago
TrustedLen will mean it can safely take the upper bound, but Vec for example will still use the lower bound of the hint when something isn't TrustedLen
https://doc.rust-lang.org/src/alloc/vec/spec_from_iter_nested.rs.html https://doc.rust-lang.org/src/alloc/vec/spec_from_iter_neste...
- tialaramex 4y agoOoh nice, I hadn't seen that. OK, so there are probably places where I assumed the iterator won't do as nice a job of collect() as I did manually but I was wrong. I wonder how the hell I didn't see that when I was tracking down how collect() ends up caring about TrustedLen. Thanks.