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

  • Rust Programming Cookbook
  • Claus Matzinger
  • 76字
  • 2021-06-24 12:27:48

Complex conditions with pattern matching

As shown in the previous recipe, pattern matching is very useful with enums. However, there is more! Pattern matching is a construct that originates in functional languages and curtails much of the choice between conditional branches and the assignment of properties in struct that commonly follows. These steps are taken at once, reducing the amount of code on the screen and creating something akin to a higher-order switch-case statement. 

主站蜘蛛池模板: 洪洞县| 龙海市| 宁都县| 温宿县| 吐鲁番市| 错那县| 仁寿县| 蓬溪县| 建始县| 分宜县| 东城区| 东乡| 沾益县| 菏泽市| 化隆| 衡山县| 沭阳县| 嘉峪关市| 吉安县| 吉首市| 金塔县| 日土县| 岫岩| 冀州市| 榕江县| 朝阳县| 喀什市| 井陉县| 开平市| 黔江区| 宁国市| 渭源县| 罗平县| 昔阳县| 上高县| 浠水县| 曲阜市| 新郑市| 宜兴市| 石楼县| 栖霞市|