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

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.

主站蜘蛛池模板: 香港| 阿坝| 山东省| 苏尼特右旗| 长顺县| 永川市| 蒙阴县| 亳州市| 邢台县| 临洮县| 汶上县| 宕昌县| 华安县| 台东市| 桐庐县| 拉萨市| 新余市| 灵台县| 谷城县| 保定市| 石柱| 苍梧县| 江阴市| 德阳市| 白玉县| 景谷| 锦屏县| 加查县| 葫芦岛市| 盘锦市| 政和县| 罗定市| 大宁县| 江北区| 潢川县| 彭水| 天津市| 日土县| 巩留县| 靖远县| 甘孜县|