These are chat archives for rust-lang/rust

30th
Sep 2016
saturn-web
@saturn-web
Sep 30 2016 04:57
Hi! Rust doesn't have increment? (++i, i++)
saturn-web
@saturn-web
Sep 30 2016 05:03
@ozkriff ok, (i+=1) also cannot be made worked?

src/main.rs:2:12: 2:19 error: binary operation `+` cannot be applied to type `()` [E0369]
src/main.rs:2  let str = (i+=1 )+ (i+=1);
Andrey Lesnikov
@ozkriff
Sep 30 2016 05:06
That's the point - compound assignment always returns () and may be used only as statement
saturn-web
@saturn-web
Sep 30 2016 05:34
How to made for(i=0; i < 10; i+=2) in rust?
saturn-web
@saturn-web
Sep 30 2016 05:37
@ozkriff thanks
Andrey Lesnikov
@ozkriff
Sep 30 2016 05:57
step_by is unstable right now, but you can use https://docs.rs/itertools/0.5.1/itertools/trait.Itertools.html#method.step for now
Ian Henry
@eeyun
Sep 30 2016 11:35
that rust 1.12 release tho!
mhsjlw
@mhsjlw
Sep 30 2016 11:47
oh , yeah it looks nice !
Sascha Grunert
@saschagrunert
Sep 30 2016 19:11
:+1: