FuelLabs/sway

Document the `const` keyword in the Sway Book

开放

#1,892 创建于 2022年6月7日

 (1 条评论) (0 个反应) (0 位负责人)Rust (5,421 个派生)batch import
The Sway Bookgood first issue

仓库指标

星标
 (61,702 个星标)
PR 合并指标
 (平均合并 22小时 6分钟) (30 天内合并 16 个 PR)

描述

const is used in multiple places in the Sway Book but it should have its own section that explains how and where it can be used (e.g. local or global scope) and its limitations (e.g. no const structs yet).

Also, we are now able to use const in more places like constant structs for examples. We should point that out and indicate when const is usable today.

Finally, document when pub is needed. (ref: https://github.com/FuelLabs/sway/pull/2230)

贡献者指南