πŸ¦€πŸ€“πŸ‘ΉπŸ’© play.rust-lang.org/?version=…
3
1
ternary conditional expressions in CPL and BCPL use b -> t, f instead of b ? t : f
2
2
damnit i’m typing ?: into my rust again
2
what i actually want is list.get(i-1) instead of writing it out longhand
2
If I knew the shape of what you had and what you wanted, I might be able to make a suggestion.
1
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
i want something like a backwards .peek()
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
but it is if i slap a .peekable() on it
1
Replying to @fanf
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) ?

May 11, 2021 Β· 3:32 PM UTC

1
Replying to @dsilverstone
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