Comment on Give me Options or give me death

<- View Parent
anton@lemmy.blahaj.zone ⁨8⁩ ⁨months⁩ ago

You can’t random-access an iterator and use it again later.

If your specific use case really needs random access to a list while lazy computing the elements just wrap them in Lazy and put them in a vector.

Can Rust compute the value of calling a function an infinite number of times?

The return type of an infinitely recursive function / infinite loops is ⊥, a type that by definition has no values. (Known in rust as !)

source
Sort:hotnewtop