I’m new to Rust, and have yet to finish the “book” so please forgive my ignorance if something like this exists already:
Does Rust have a pipe operator, or have any plans to implement a pipe operator like some other languages have (i.e. F# and Elixir)?
By pipe operator I mean this:
[ 1, 2, 3, 4, 5 ] |> iterate();
Where the results from the left hand side of the pipe ( |> ) are inserted into the first parameter of the function on the right hand side.
It makes code much easier to read especially in instances where you have something like this:
a( b( c( d() ) ) );
With a pipe operator you would write the above like:
or short hand: d() |> c() |> b() |> a()
This way the order of operations reads in like they happen rather than having to read the operations from the inside out.