FuelLabs/sway

Document the `const` keyword in the Sway Book

オープン

#1,892 opened on 2022/06/07

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (5,421 件のフォーク)batch import
The Sway Bookgood first issue

Repository metrics

Stars
 (61,702 個のスター)
PR merge metrics
 (平均マージ 22h 6m) (30d で 16 merged PRs)

説明

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)

コントリビューターガイド