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

Accessing module contents from outside

In the A module as a section of a file section, the a_second_thing function is part of the same module as a_thing, so it's automatically allowed to use the short version of the other function's name to refer to it. However, code outside of the module needs to use the full name to refer to items inside the module. There are two ways this can be done. It can either be done directly, which is a good choice if we don't expect to be referring to the item often, or we can tell Rust that we want to use the short name for an item in a different module, which is a good choice if we're going to be using that item often in our code.

主站蜘蛛池模板: 长春市| 晴隆县| 嵊州市| 栾城县| 深泽县| 阳西县| 邵阳县| 莱州市| 深州市| 广河县| 紫金县| 景东| 永平县| 黄冈市| 法库县| 岚皋县| 乳山市| 威宁| 长治市| 阿城市| 楚雄市| 惠安县| 师宗县| 密山市| 乐清市| 开原市| 濉溪县| 八宿县| 浪卡子县| 岳普湖县| 二手房| 霍林郭勒市| 梁山县| 信丰县| 武冈市| 通江县| 筠连县| 隆德县| 车险| 景洪市| 田阳县|