well i started with something like line 581 except using [] instead of .get(), then i realised everything needed to be Option<>al, so I used bare .get(), then the compiler complained at me for doing 0usize - 1usize so i put one of the if{}else{}s back
github.com/fanf2/leapsecs/blβ¦
1
hmm but i can do a backwards peek with a mutable prev variable
and now my problem is that slice::Iter isnβt peekable
1
I'm just trying to grok what you actually need in terms of data. Is it that for each entry in the list you want (prev,this,next) where at the start that'd be (None,entry,Some(next)) and a the end it'd be (Some(prev),entry,None) ?
1
exactly
i tried a version with .peek() and it turned out to be more annoying
play.rust-lang.org/?version=β¦
1
This isn't *quite* what you're after, but it's close (Option,Option,Option) rather than (Option,value,Option) -- play.rust-lang.org/?version=β¦
1
1
itertools is love. itertools is life.
(oh, and rayon too, rayon is happiness)
May 11, 2021 Β· 4:04 PM UTC
3

