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

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.

主站蜘蛛池模板: 浮山县| 屏东市| 调兵山市| 南涧| 凤翔县| 朝阳市| 蓝田县| 英超| 伊春市| 巴东县| 大城县| 沙田区| 长岭县| 潜山县| 江西省| 莲花县| 福建省| 中方县| 崇左市| 东安县| 潍坊市| 灵璧县| 沁源县| 河间市| 林西县| 宽甸| 苍南县| 伊金霍洛旗| 邵东县| 阳城县| 云南省| 邓州市| 邢台县| 许昌县| 财经| 富顺县| 顺平县| 济源市| 交口县| 余干县| 当雄县|