i think .collect::<Vec<_>>() is the ugliest piece of #rust code i have to write on a regular basis
yes i know i can avoid it with let x: Vec<_> = ... or even (collect_vec from itertools)[docs.rs/itertools/latest/itertβ¦]
no i don't have anything against the beloved turbofish in general
Itertools in itertools - Rust
An `Iterator` blanket implementation that provides extra adaptors and methods.docs.rs
Malva π³οΈββ§οΈπ³οΈβππ΅πΈ
in reply to Lynnesbian • • •Lynnesbian
in reply to Lynnesbian • • •it's the combination of a full stop, a short lowercase word, two colons, an angle bracket, a short titlecase word, another angle bracket, an underscore, two angle brackets, then parentheses in quick succession
a simple turbofish like
.lorem::<Ipsum>()is fine. it's when you add the generics that it gets gross.and let's not get into
.collect::<Result<HashMap<_, _>, _>()?(if that's how you even write it)soc
in reply to Lynnesbian • • •Agreed.
Similar to chaos.social/@soc/115486056084β¦, I think this is another place where Rust's punctuation situation is excessive.
I'd consider `.to[List]` to be the right level of ceremony/complexity for this functionality.
soc (@soc@chaos.social)
chaos.socialLynnesbian
in reply to soc • • •@soc rust's syntax can be kind of unappealing when you really get into the weeds of things.
i think they do a much better job than C++ on super complex types, but that's not really saying much, is it?
oh and by the way -- congratulations on being the first person to reply to me with a quote toot (or as i've recently taken to calling it, a quoot). here is your award: ποΈ /lh
soc
in reply to Lynnesbian • • •kitkat
in reply to Lynnesbian • • •Lynnesbian
in reply to kitkat • • •binchicken
in reply to Lynnesbian • • •