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

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.

主站蜘蛛池模板: 旺苍县| 浙江省| 昔阳县| 老河口市| 长葛市| 休宁县| 图们市| 静安区| 舟曲县| 望城县| 徐水县| 全州县| 托克托县| 贞丰县| 陈巴尔虎旗| 墨竹工卡县| 沂南县| 通渭县| 嘉善县| 北碚区| 台湾省| 临泉县| 大方县| 山西省| 五大连池市| 永城市| 姚安县| 建阳市| 谷城县| 清镇市| 钟山县| 白水县| 甘德县| 五峰| 富阳市| 桦南县| 九寨沟县| 读书| 永丰县| 册亨县| 随州市|