I find myself writing .iter().map(|x| ...).collect() really often in Rust. I'm wondering if I should write a helper method on Vec, but it seems less idiomatic.
Iterators compose, but they're less versatile (no indexing) and awkward to return from functions.
miniblog.
Related Posts
I've been using "Expected Int, but got String" for my type error messages, but I've been wondering if I could do better.
"Expected Int here, but this value has type String" or "This expression requires Int, but the value is String".
Do you have a favourite?
Do you have a favourite way of highlighting text in a CLI error message? Currently I'm using backticks, but I'm wondering what's the most readable.
I'm implementing an interpreter, and wondering how often I should check for interruptions (e.g. Ctrl-C).
I don't want to spend too much CPU time checking whether I've been interrupted, but I also want slow programs to stop promptly. It's tricky.

