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

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.

主站蜘蛛池模板: 阿克陶县| 哈巴河县| 芒康县| 青铜峡市| 乾安县| 平湖市| 绥滨县| 佳木斯市| 桂平市| 集贤县| 丹棱县| 泾川县| 大宁县| 云南省| 泰安市| 双流县| 德安县| 新安县| 白沙| 海兴县| 三穗县| 平塘县| 乌恰县| 沈丘县| 固安县| 涡阳县| 德昌县| 建水县| 博兴县| 泸水县| 和硕县| 霍州市| 康定县| 卫辉市| 平果县| 崇州市| 岳西县| 河北省| 耒阳市| 鄂温| 左贡县|