官术网_书友最值得收藏!

How it works...

Although not vastly different from many languages' control statements, the basic constructs in Rust can change the way you think about variable assignments. It certainly transformed our mental models to be more data-focused. This means that instead of thinking if this condition is reached, assign this other value to a variable, a reversed assign this other value to a variable if this condition is reached—or shorter transform this variable if this condition applies—may take over. 

This is the functional stream in the Rust programming language and it lends itself well to shortening and focusing the important parts of a piece of code. Similar implications can be made from the loop constructs since everything is a scope and has a return value. Using these capabilities will make every program a lot more readable and shorter, especially if it's just simple operations. 

We've successfully learned how to control execution flow. Now, let's move on to the next recipe.

主站蜘蛛池模板: 日喀则市| 华安县| 常州市| 枞阳县| 万载县| 嘉禾县| 区。| 北海市| 阳高县| 平顺县| 兴海县| 南靖县| 清涧县| 靖西县| 平利县| 灯塔市| 阿克陶县| 常德市| 博爱县| 来宾市| 南部县| 德江县| 康定县| 田林县| 渑池县| 磴口县| 芷江| 荥经县| 建昌县| 上林县| 西平县| 刚察县| 广宗县| 白山市| 中牟县| 柳江县| 大悟县| 武义县| 邹城市| 建始县| 鄂伦春自治旗|